良好的桌面练习 - 在桌子上做标题的最佳方法?

3 html html-table header spacing

我基本上有一个数据表,我想设置间距,所以它不是所有的局促.但是,我希望表(第一行)的标题栏忽略单元格填充规则.

有没有办法做到这一点?或者我是否必须为标题创建单独的表格或其他内容?

cle*_*tus 14

是的,在你的CSS中:

table thead th { padding: 0; }
table tbody td { padding: 15px; }
Run Code Online (Sandbox Code Playgroud)

假设:

<table>
<thead>
<tr>
  <th colspan="4">Big Heading</th>
</tr>
</thead>
<tbody>
<tr>
  <td>1</td>
  <td>2</td>
  <td>3</td>
  <td>4</td>
</tr>
</tbody>
</table>
Run Code Online (Sandbox Code Playgroud)