小编Ink*_*oed的帖子

如何使用 CSS 在 HTML 中的单元格之间的边框间距中填充颜色

我正在尝试在 html 中表格的垂直单元格间距(列)之间填充黑色,但不知道该怎么做。这是我的代码


table,
th,
td {
  border-collapse: separate;
  border-spacing: 2px;
  border-style: solid;
  border-width: thin;
}
Run Code Online (Sandbox Code Playgroud)
<table>
  <tr>
    <th>Heading One</th>
    <th>Heading Two</th>
    <th>Heading Three</th>
  </tr>

  <tr>
    <td>Apple</td>
    <td>10</td>
    <td>$1.0</td>
  </tr>

  <tr>
    <td>Mango</td>
    <td>12</td>
    <td>$2.0</td>
  </tr>
</table>
Run Code Online (Sandbox Code Playgroud)

html css html-table colors

6
推荐指数
2
解决办法
1万
查看次数

标签 统计

colors ×1

css ×1

html ×1

html-table ×1