473,383 Members | 1,984 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Table Within Table with colspan and width=100%

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>

Aug 15 '05 #1
2 7767
st**************@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
Aug 15 '05 #2
st**************@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, 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>


I am not totally sure I understand what you are trying to do, but have
you tried deleting your <col> tags and putting width="100%" as a
parameter on the outer table tag?

--

Søren Beck
Costa Tropical Internet

so***@costatropicalinternet.com
http://www.costatropicalinternet.com

Phone/Fax: +34 958 61 13 89
Aug 26 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Chris Leipold | last post by:
Hi, I have a problem with an element of 100% width and a left paddig. The effect I try to achieve is easy, take a look at: http://swing-tanzen-verboten.de/test.html My Problem is, the width...
3
by: fred | last post by:
Why does not the below code work in IE or FF? I have a table taking up the full browser window made up of three rows. The middle row has an ID of "row" and contains a div with an ID of "div". ...
2
by: netram | last post by:
See the below url http://dilenbonazzi.glimworm.com/_site1125/splash.html after loading you'll see a white space on the right side of the browser window click on refresh and you will see...
3
by: Robert | last post by:
Hi, Could anyone explain the behaviour of my simple table at http://www.xs4all.nl/~rvanloen/example/table1/table.html The css is located at:...
2
by: James Frayne | last post by:
Hi, I am trying to integrate phpBB into my existing site design. I am doing this simply by pasting fragments of my HTML into the phpBB templates. This works fine in Firefox and Opera but the...
3
by: VK | last post by:
Stock in one strange problem equal to both FF and IE. With form width set to 100% the right border of form goes hell knows where behind the screen. Is there a way to tell reliably to form to...
0
by: mephraim | last post by:
I have a page at (view in IE): http://rmc2.dev.leepfrog.com/ie_fix_me/index.html that has an image floated right outside of a main content div that looks like: <img src="blah" style="float:...
3
by: gvdmoort | last post by:
Hello, I've a problem with a table whose the witdh is 100%. With Firefox, it correctly fits the width of the parent container, no more. But with IExplorer, the witdth seems to be equal to the...
4
by: lilOlMe | last post by:
Hi there! I'm developing a "scrollable table". At first I started using CSS. It worked pretty well until I found a bug that happens when placing this table into a tabbing control... So I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.