View Single Post
Old 08-28-2020, 05:03 PM   #4
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,589
Karma: 14328510
Join Date: Nov 2019
Device: none
Here is the CSS I use for HTML tables. The last 4, coltwonum (column two, numeric) etc. are for columns where it's decimal numbers, e.g., 2.34, to force right alignment so that the decimal points line up. tr.final is for a row where the values are a sum of the columns.

Code:
table {
    margin-left: auto;
    margin-right: auto;
    border-collapse: collapse;
    margin-top: 1em;
}

table caption {
    font-weight: bold;
    padding-bottom: 0.5em;
}

td {
    border: 1px solid currentColor;
    empty-cells: show;
    padding: 0.125em;
    text-align: left;
}

tr.final {
   border-top:  2px solid currentColor;
}

table.coltwonum td:nth-child(2) {
    text-align: right;
}

table.colsthreenum td:nth-child(3) {
    text-align: right;
}

table.colfournum td:nth-child(4) {
    text-align: right;
}

table.colfivenum td:nth-child(5) {
    text-align: right;
}
hobnail is offline   Reply With Quote