[thelist] Table weirdness, unwanted spaces in cells

Sam-I-Am sam at sam-i-am.com
Tue Jul 31 17:36:33 CDT 2001


hi Elfur, 
Ah. This is a classic case for a "shim row". As you are using colspans
in every row in the outermost table, the widths of those columns are
left somewhat ambiguous to the browser. It makes life so much easier for
it's poor cranky old rendering engine if you tell it explicity (with a
fixed width element like a spacer gif) "this column should be this
wide".

So a shim row is an otherwise empty row of tds up top (better) or bottom
(if the design requires it) with just spacers setting the exact widths.
You should find with just that things work out a lot better
This also makes your table a lot easier to read! Instead of picking
through each column and each row figuring out colspans and subtracting
this from that (which is incidentally pretty much what the browser has
to do too) you have a handy reference up top.

so check out
http://www.sam-i-am.com/temp/elfur_table.html

if you're a Homesite user I have a handy tool I find invaluable for this
kind of work:
http://www.sam-i-am.com/work/homesite/hs_totalimgwidths.html
It sums the widths of images in the selection for you.

hth
Sam


Elfur Logadottir wrote:
> 
> From: "aardvark" <roselli at earthlink.net>
> 
> | > the error: cells are displayed wider than defined.
> |
> | this often happens when there is no reason for a cell to restrict its
> | width... for the short term, try testing it with a row of spacer.gifs in
> | exactly the sizing you need... see if that tightens it up...
> 
> thanks aardie,
> but, i have spacer gifs, and every cell is at least it's assigned width -
> my problem is that two cells in the top row are *larger* than they are
> supposed to and are therefor enlarging the total width of the table - those
> two cells are not taking space from other cells, just adding to the total
> width of the table.
> ....




More information about the thelist mailing list