How can I set the width of an td to 0? I have a td without any content in it but it has always a width of 2px.
My first suspicion was the border-spacing property but setting it to 0 doesn't help neither.
<table>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table>
See Sample
Set td
s padding to 0 adding padding: 0;
to your td
css rule.
You'll need to remove the padding. ( td { padding: 0; })
Modern web browsers make it quite easy to track down questions like this. For example, using the Chrome Developer tools you can highlight the element and take a look at the Metrics tab and find out what is causing your width.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With