table percentages

message from A.H.O. on 20 Jul 2004
If I put two tables side by side in a page and give them each 50% width...I
think this would make both tables equal width in any size browser window
correct?

Now if I put columns in each of those table I can specify a width for each
column cant I? This kind of mirrors my other post but my big question is...If
I put say...4 columns in each 50% table would I want to make the coumn
percentages add up to 50% or 100%? IE do they sizr based on the table they are
in so they would ad up to 100% of the table width, or would it be adding up to
the browser window width making them add up to 50% (based on being in a 50%
table)?

I hope I made that clear enough.

Thanks
 
Alan replied to A.H.O. on 19 Jul 2004
Put in one table, with one row, two columns.
Set each cell to 50 percent.
You could put your content directly into those cells, or nest new single
cell tables in each cell.
(If dw is in Layout Mode- get out of Layout Mode and into Standard or
Regular table editing)

using the Align attribute in the Property inspector to have two tables sit
side by side won't work as expected in some cases

If you want to further sub-divide those into more columns- use a percentage
width based on the most immediate table tag, if using nested tables.
Percentage widths of td are based on the table, not the page width.
Percentage widths of <table> are based on percentage of what they are
contained in- If they are inside of another table cell- then percenage of
that cell. If the container is the <body> then it's the page width
 
Murray *TMM* replied to Alan on 20 Jul 2004
It's because the table will do what its content requires and ignore your
dimensions. That's why we tell people to not use dimensions.

Please go through the table tutorials at the DW FAQ link. It'll give you a
better understanding of this.
 
James Shook replied to A.H.O. on 20 Jul 2004
In theory you would make each column 20%, since the percentage is
calculated with reference to the table's container (in this case, the
cell in the outer table) which is treated as 100%. The fact that the
outer table cell is 50% of the screen's width does not matter.

That's the theory. In practice there are many factors which will prevent
each column from rendering at exactly the same width as the others. The
browser will try to make this work, but will jump at any excuse to make
the columns unequal widths. The biggest wild card is text, which in
general browsers try to keep on one line until some immovable object
(like the edge of the browser window) forces it to wrap. In your example
you have several levels of dynamics (conflicting factors like widths
specified in the code vs. content) that the browser needs to satisfy in
the way it sees fit. This may involve ignoring your column widths at the
first and/or second level.

With a multi-columned table with each column containing text, I have
seen browsers push the first column to a much wider width than
specified, allowing much less space for the remaining columns.
Apparently the browser's desire not to wrap text until absolutely
necessary got the upper hand.

I have found that if the first element in each column is the same width,
the percentage widths will be honored. For example, I have a page with a
seven-columned table. The table has four rows. In the first row, each
column has a graphic that is exactly 128 pixels wide. The table is set
to 100%. I have explicitly set the width of each column to 14%. Even
though 14 x 7 = 98, each column displays at the same width as the
others. Frankly, I regard this as HTML voodoo since I have no idea why
it works. I just got there via trial and error. But the key seems to be
that the first cell in each column has a graphic that is the same width.
This makes the browser apportion the column widths evenly, even when the
widths specified in the code don't add up to 100%. Go figure.
 

Archived message: table percentages (Macromedia Dreamweaver Web Design)