In an HTML table, the cellpadding and cellspacing can be set like this:
相关标签:
-
2020-11-22 02:39
table
{
border-collapse: collapse; /* 'cellspacing' equivalent */
}
table td, table th
{
padding: 0; /* 'cellpadding' equivalent */
}
-
2020-11-22 02:42
Just use border-collapse: collapse for your table, and padding for th or td.
-
2020-11-22 02:43
TBH. For all the fannying around with CSS you might as well just use cellpadding="0" cellspacing="0" since they are not deprecated...
Anyone else suggesting margins on <td>'s obviously has not tried this.
-
2020-11-22 02:43
table {
border-spacing: 4px;
color: #000;
background: #ccc;
}
td {
padding-left: 4px;
}