.comment-link {margin-left:.6em;} <$BlogRSDURL$>
One New Thing
Wednesday, September 15, 2004
One New Thing: Cellspacing and Cellpadding.

A little trick of HTML I somehow missed learning in the past:
Cellpadding is a value that adjusts the space in a table cell between the text and the edge of the cell. This I use all the time, so the text doesn’t run into the table border or the text in the next cell too much. Cellspacing I hardly ever used, although I knew it was the distance between the cell and the next cell over – although I never worked out why you would need it, since all my cells came with cellpadding. Now I’ve discovered that if your table has a background and no borders, and you want the background to be a solid block, you have to define the cellpadding as “0” because browsers (well mine anyhow!) doesn’t automatically display with 0 cellpadding (that is, no space between cells) if you haven’t mentioned your cellpadding at all: when I naively thought it would. All these things I never knew I never knew!

Comments: Post a Comment

Links to this post:

Create a Link