显示所有 table 个边框,除了周围的边框

Show all table borders except for surrounding ones

我正在努力实现这一目标:

但我整天都在努力做到这一点。作为记录,它需要是 <table> 标签。

这是您要找的吗? https://jsfiddle.net/pgnzyht6/

html

<table>
    <tr>
        <th>Heading 1</th>
        <th>Heading 2</th>
        <th>Heading 3</th>
    </tr>
    <tr>
        <td>cell</td>
        <td>cell</td>
        <td>cell</td>
    </tr>
    <tr>
        <td>cell</td>
        <td>cell</td>
        <td>cell</td>
    </tr>
    <tr>
        <td>cell</td>
        <td>cell</td>
        <td>cell</td>
    </tr>
</table>

css

table { border-collapse: collapse; }

td + td,
th + th{ border-left: 1px solid; }
tr + tr{ border-top: 1px solid; }