We get rid from cellpadding and cellspacing
All correct boys and girls already for a long time do not write <table cellpadding = "0" cellspacing = "0" border = "0">. They know, that it is better to write style once:
table {
border:0px;/* border = "0" */
border-collapse:collapse;/* cellspacing = "0" */
}
table td {
padding:0px;/* cellspadding = "0" */
}
HTML a code:
<table>
<tr>
<td> Foo </td>
<td> Bar </td>
</tr>
</table>
When it is necessary to receive other kind of the table, all correct boys and girls redefine this base style, for fidelity sometimes with the help! important:
table.stuff {
border-collapse:separate;
}
table.stuff td {
padding:5px 10px;
border:1px solid *666666;
}
HTML a code:
<table class = "stuff">
<tr>
<td> Foo 2 </td>
<td> Bar 2 </td>
</tr>
</table>
And some boys and girls even know, that is such CSS property, as border-spacing. But they also know, that it at all does not work in Internet Explorer. Therefore rastojanie between cells at border-collapse:separate always in this browser identical, equal 2 px.

|