tables, tables everywhere...

navigation


memberships

Make payments with PayPal - it's fast, free and secure!
The Light Box.  A forum for photographers.
Photographic!
The Photo Forum

 table tips, tricks & pratfalls  

Bimjo! Why does my table do this weird stuff that drives me nuts?

Tables can certainly be maddening. Fortunately, they've been around long enough that I feel safe in saying that there probably aren't any new ways for a table to mess you up. I mean, somebody has figured out how to fix what's wrong with yours. It's just a matter of finding the answer to the problem.

  • spacing - sothingsaren'tsocrowded
  • gotchas - those pesky little things that make you pull out your hair
  • graphics in tables - how to make that killer interface work

 spacing in tables  

Spacing in tables is controlled by several factors. If you place your text inside <p> tags, there's a certain spacing that tag carries with it. Within the table structure itself are three factors that control how table contents are spaced:

  • table border
  • cellpadding
  • cellspacing

Taken one at a time then, we'll start with the...

border attribute. It is best to specify a border value in your tables even if you don't want a border. Huh? Here's why- some browsers have a default value of 1 (no units) for table borders. If you leave it out, it can still create gaps in your table. Normally not a problem, but very noticeable when using tables to place graphics as part of a page layout.

Fix: add border="0" to the <table> tag



Cellpadding. Definition- the space between the inner walls of the cell and the cell contents. An example, on the top cellpadding set to zero, on the bottom it's set to 10.

cellpadding=0
cellpadding=10


Cellspacing. Definition- the physical space between the cells of a table. Can cause unwanted gaps in your table, or create a lined effect that you may find attractive, something like this:

cellpadding=0 cellspacing=0
cellpadding=10 cellspacing=10


In the example above, the orange represents the cellspacing (value 10) added to the lower table. The upper table has cellspacing, and cellpadding set to a zero value.

<< back

 yank my chain  

Feel the need to communicate with His Grand & Exalted Bimjoness hisself?? Well, here's where ya do it! Don't be shy. If you have something you'd like to see here, just let me know and I'll see what I can do about getting it on here.

Man, this page looks so... sucky!

Yep, because all the formatting on the page is controlled by CSS. You can still see everything the site has to offer, it just looks, well... sucky. You can live with it, or you can do something about it. Assuming you have control over your browser selection and the hardware necessary to upgrade.

If you are looking for alternative browsers that are standards compliant, webstandards.org has a number of options for you to explore. So, go ahead, see what this site really looks like.