CSS table cellpadding and cellspacing?
table {
border-collapse: collapse;
}
th, td {
padding: 0;
}
The accepted answer of border-collapse:collapse;
is not the right way to get rid of cellspacing
. It works for simple solid
border styles, but it is easily seen to be wrong if td{border}
is set to something complicated, like inset
or outset
. The right answer is border-spacing:0;