Click here to get back home

Table Within Table with colspan and width=100%

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Table Within Table with colspan and width=100% steventhrasher42 08-15-2005
Posted by steventhrasher42 on August 15, 2005, 10:41 am
Please log in for more thread options


I can't figure out a way to possibly make this work in HTML. I have a
table embedded in another table, with the inner table spanning a few
columns. I would like for the outer table to span the width of the
page. The problem is that the 2nd row that contains the colspan'ed
cell with the inner table in it is wider than it needs to be (there's
blank space at the end) which causes the top row to be wider than it
needs to be. Why, and is there a workaround?

Sample HTML follows... Assume the number of columns and widths of
these columns can be variable since the page is generated dynamically.
Also assume I have to have the outer table to keep columns aligned on
consecutive rows.

Thanks!

<HTML>
<BODY>

<TABLE BORDER=1>
<COL>
<COL>
<COL WIDTH=100%>

<TR>
<TD NOWRAP>Outer Table Cell</TD>
<TD NOWRAP>Outer Table Cell</TD>
<TD NOWRAP>Outer Table Cell</TD>
</TR>

<TR>
<TD COLSPAN=3>

<TABLE BORDER=1>

<TR>
<TD NOWRAP>Inner Table Cell</TD>
<TD NOWRAP>Inner Table Cell</TD>
<TD NOWRAP>Inner Table Cell</TD>
<TD NOWRAP>Inner Table Cell</TD>
<TD NOWRAP>Inner Table Cell</TD>
<TD NOWRAP>Inner Table Cell</TD>
<TD NOWRAP>Inner Table Cell</TD>
<TD NOWRAP>Inner Table Cell</TD>
<TD NOWRAP>Inner Table Cell</TD>
<TD NOWRAP>Inner Table Cell</TD>
<TD NOWRAP>Inner Table Cell</TD>
</TR>

</TABLE>

</TD>
</TR>

</TABLE>

</BODY>
</HTML>


Posted by David Dorward on August 15, 2005, 8:59 pm
Please log in for more thread options


steventhrasher42@hotmail.com wrote:

> I can't figure out a way to possibly make this work in HTML. I have a
> table embedded in another table

http://dorward.me.uk/www/nested/

> Sample HTML follows

> <COL>
> <COL>
> <COL WIDTH=100%>

Well that's invalid (Attribute values may be unquoted if they contain only
certain characters, % isn't one of them).

http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.2.2

... and it doesn't make sense anyway. One column uses up ALL the room, yet
there are two more columns.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is

Similar ThreadsPosted
Table COLSPAN & ROWSPAN October 25, 2005, 8:22 am
Colspan - rowspan HTML Table August 19, 2004, 3:08 am
Newbie: Problems with table cells & colspan August 9, 2004, 7:11 pm
html table, colspan weirdness I don't know how to work around April 18, 2006, 10:26 pm
[newbie] client side jscript for a table inside a table March 24, 2005, 8:01 am
How to eliminate space between table border and table contents? December 6, 2005, 1:22 am
How do you make a table background cover whole table August 3, 2004, 9:49 pm
IE7: Table in Table November 24, 2006, 12:56 am
vs.
when and where
March 10, 2007, 4:47 am
Table border (outside only) August 6, 2004, 8:16 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap