some Folk some Folk - 1 year ago 129
CSS Question

CSS table default padding or margin

Today it's my first time I'm playing around with tables
and I have noticing that the table and tr and td tags have a little space between them,
like 1 px or so.

So here is my problem :

There is my code :

<table id="upload_box_container">
<td class="border_bottom_1px">hi1</td>
<td class="border_bottom_1px">hi2</td>

(upload_box_container - it's just background color and border color)

(border_bottom_1px - as it's name it only gives bottom border with 1px size)

and there is a picture of how it displays:

My question is

  • why there is a space between the two bottom borders

  • and why there is a space in the sides of the table (like padding) and the borders don't touch the table border


Answer Source


table { border-spacing:0; }

and it should render in the way you want.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download