Here's some reasonable CSS that matches your described goal:
/* Make horizontal lines connect through column boundaries */
table {
border-collapse: collapse;
}
/* General styling of all cells */
table > :is(thead, tbody) > tr > :is(th, td) {
padding: 3px;
text-align: left;
}
table > thead > tr > :is(th, td) {
border-top: 2px solid; /* Top thick line */
border-bottom: 1px solid; /* Below head thin line */
}
table > tbody > tr:last-child > :is(th, td) {
border-bottom: 2px solid; /* Bottom thick line */
}
To demo this, I made this Markdown table:
| Animal | Description | Price |
|--------|-------------|------:|
| Gnat | per gram | 13.65 |
| | each | 0.01 |
| Gnu | stuffed | 92.50 |
| Emu | stuffed | 33.33 |
| Armadillo | frozen | 8.99 |
It renders on StackOverflow here as the following HTML:
Animal |
Description |
Price |
Gnat |
per gram |
13.65 |
|
each |
0.01 |
Gnu |
stuffed |
92.50 |
Emu |
stuffed |
33.33 |
Armadillo |
frozen |
8.99 |
Now taking that HTML and adding CSS styling to it, we get this demo:
table {
border-collapse: collapse;
}
table > :is(thead, tbody) > tr > :is(th, td) {
padding: 3px;
text-align: left;
}
table > thead > tr > :is(th, td) {
border-top: 2px solid;
border-bottom: 1px solid;
}
table > tbody > tr:last-child > :is(th, td) {
border-bottom: 2px solid;
}
<table class="s-table"><thead>
<tr>
<th>Animal</th>
<th>Description</th>
<th style="text-align:right">Price</th>
</tr>
</thead>
<tbody>
<tr>
<td>Gnat</td>
<td>per gram</td>
<td style="text-align:right">13.65</td>
</tr>
<tr>
<td></td>
<td>each</td>
<td style="text-align:right">0.01</td>
</tr>
<tr>
<td>Gnu</td>
<td>stuffed</td>
<td style="text-align:right">92.50</td>
</tr>
<tr>
<td>Emu</td>
<td>stuffed</td>
<td style="text-align:right">33.33</td>
</tr>
<tr>
<td>Armadillo</td>
<td>frozen</td>
<td style="text-align:right">8.99</td>
</tr>
</tbody>
</table>
It's not possible to do multi-column cells in Markdown tables, but there are workarounds. It's also not possible to do multiple header rows, I'm afraid. But you could probably manually embed a <table>
with your own <thead>
and <td colspan=2>
and so on. (I tried Typora Markdown briefly, but couldn't figure out how to use it well, so I don't know exactly what it supports.)