"Graham J" <in***************@orangebucket.co.uk>:
Apologies for the partial post that mysteriously escaped as I was composing.
I shall try again.
For many years I have been happily and successfully coding tables such that
the WIDTH
specified in a TD is the complete column width including any CELLPADDING.
For example for a 400 pixel wide table with four 100 pixel wide columns and
10 pixel cellpadding...
<TABLE WIDTH="400" BORDER="0" CELLSPACING="0" CELLPADDING="10">
<TR>
<TD WIDTH="100">
<TD WIDTH="100">
<TD WIDTH="100">
<TD WIDTH="100">
</TR>
</TABLE>
This is, to me, intuitive and is clearly how many others think it should be
done too judging by tutorials on the net and actual coding used. However
while using GoLive 6.01 (and this is not something I noticed with earlier
versions) I noticed that it considers that the WIDTH only covers the content
and excludes the CELLPADDING. So it would suggest...
<TABLE WIDTH="400" BORDER="0" CELLSPACING="0" CELLPADDING="10">
<TR>
<TD WIDTH="80">
<TD WIDTH="80">
<TD WIDTH="80">
<TD WIDTH="80">
</TR>
</TABLE>
...is actually correct and many seem to agree with this too. I'd like to
think Adobe know more about it than I do but...
I have checked text books, the HTML 4.0 reference on w3.org, assorted
tutorials on the net and tried to check through newsgroup archives and I
still can't find a definitive answer. Most just say that the width is the
'column width' but do not say if that is the width of the content or of the
whole cell including padding.
So if we could ignore any factors like bad style and deprecation, I would
like to know which one is considered correct and ideally see some evidence
for why it is correct because I can't find it.
The excercise is quite futile I prefer to think because you are not
providing the neccesary info about the kind of content you are putting
inside the cells nor what you want to achieve, i.e. an outside size of
400 or columns with max contentsize of 100 (80?).
And I would assume that after so many years succesfully coding tables
you could do the excercise yourself?
The table principle is that the table will first try to maintain the
width="400" if you insist on specifying that value.
However if you fill the 4 cells as follows:
<TD WIDTH="100"><img src="blue.gif" width="100" height="100"></td>
you will never have a table which is 400 wide.
On the other hand if you specify cells with text like so:
<TD WIDTH="100"><p>M M M M M M M M M M M M M M </p></td>
your table will attempt to remain at 400 (outside size incl. padding
and spacing).
A combination of 2x img + 2x text will result in 2 wide img cells and
2 narrow txt cells because you specified 400.
On the other hand if you are not specifying a width of 400, then all
combinations will give you the same result because the cells will try
to remain 100.
Copy this into a page and look/measure at the result:
<TABLE WIDTH="400" BORDER="1" CELLSPACING="0" CELLPADDING="10">
<TR>
<TD WIDTH="100"><img src="pics/dot_blue.gif" width="100"
height="100"></td>
<TD WIDTH="100"><img src="pics/dot_blue.gif" width="100"
height="100"></td>
<TD WIDTH="100"><img src="pics/dot_blue.gif" width="100"
height="100"></td>
<TD WIDTH="100"><img src="pics/dot_blue.gif" width="100"
height="100"></td>
</TR>
</TABLE>
<TABLE WIDTH="400" BORDER="1" CELLSPACING="0" CELLPADDING="10">
<TR>
<TD WIDTH="100"><p>M M M M M M M M M M M M M M </p></td>
<TD WIDTH="100"><p>M M M M M M M M M M M M M M </p></td>
<TD WIDTH="100"><p>M M M M M M M M M M M M M M </p></td>
<TD WIDTH="100"><p>M M M M M M M M M M M M M M </p></td>
</TR>
</TABLE>
<TABLE WIDTH="400" BORDER="1" CELLSPACING="0" CELLPADDING="10">
<TR>
<TD WIDTH="100"><img src="pics/dot_blue.gif" width="100"
height="100"></td>
<TD WIDTH="100"><img src="pics/dot_blue.gif" width="100"
height="100"></td>
<TD WIDTH="100"><p>M M M M M M M M M M M M M M </p></td>
<TD WIDTH="100"><p>M M M M M M M M M M M M M M </p></td>
</TR>
</TABLE>
<TABLE BORDER="1" CELLSPACING="0" CELLPADDING="10">
<TR>
<TD WIDTH="100"><img src="pics/dot_blue.gif" width="100"
height="100"></td>
<TD WIDTH="100"><img src="pics/dot_blue.gif" width="100"
height="100"></td>
<TD WIDTH="100"><img src="pics/dot_blue.gif" width="100"
height="100"></td>
<TD WIDTH="100"><img src="pics/dot_blue.gif" width="100"
height="100"></td>
</TR>
</TABLE>
<TABLE BORDER="1" CELLSPACING="0" CELLPADDING="10">
<TR>
<TD WIDTH="100"><p>M M M M M M M M M M M M M M </p></td>
<TD WIDTH="100"><p>M M M M M M M M M M M M M M </p></td>
<TD WIDTH="100"><p>M M M M M M M M M M M M M M </p></td>
<TD WIDTH="100"><p>M M M M M M M M M M M M M M </p></td>
</TR>
</TABLE>
<TABLE BORDER="1" CELLSPACING="0" CELLPADDING="10">
<TR>
<TD WIDTH="100"><img src="pics/dot_blue.gif" width="100"
height="100"></td>
<TD WIDTH="100"><img src="pics/dot_blue.gif" width="100"
height="100"></td>
<TD WIDTH="100"><p>M M M M M M M M M M M M M M </p></td>
<TD WIDTH="100"><p>M M M M M M M M M M M M M M </p></td>
</TR>
</TABLE>
John OO
--
<http://webcel.nl/>
<http://www.webcel.nl/bayshop/shop/bayshop.html>
"Time is what prevents everything from happening at once"
- John Archibald Wheeler -