Forum Moderators: open

Message Too Old, No Replies

Sizing a nested <table> to fill the parent table

         

peterinwa

7:34 am on Jun 28, 2004 (gmt 0)

10+ Year Member



If I put a table inside another table, is there a way to size the inner table to fill the outer table?

tedster

7:49 am on Jun 28, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If I understand you correctly, the answer is yes. Make sure the outer table is cellpadding=0 and cellspacing=0 -- otherwise you get a default of 1px for these attributes and there are little "slivers" that the inner table doesn't fill.

Then the inner table must be inside a <td> and you declare the inner table's width as width=100%

peterinwa

10:25 pm on Jun 28, 2004 (gmt 0)

10+ Year Member



Thanks! Worked great.

Also learning about the defaults was real valuable as I assumed they were zero. Setting cellspacing=0 is "tightening" up a lot of my pages.