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;
}