Click here to get back home

table alignment problem

 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 alignment problem Andy Flash 01-30-2005
Get Chitika Premium
Posted by Andy Flash on January 30, 2005, 10:48 pm
Please log in for more thread options
Hi.

I'd like a little help working out what is going on with what should
be a simple alignment problem.

I have an outer table with a <td> which has an inner table.

The <td> specified as width=200 has the inner table which is
width=100%

But I can't make the inner table appear as 100% the width of the cell
unless the cell is at least half the width of the outer table.

If this is normal behaviour, why is it like that? It kinda defies my
view of logic.



<body>

<table width="780" border="1">
        <tr>
                <td width="200">
                
                <table bgcolor="#FF0000" width="100%" border="1">
                        <tr>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                        </tr>
                </table>
                
                </td>
                <td width="394">&nbsp;</td>
        </tr>
</table>

</body>



Posted by David Biddulph on January 30, 2005, 12:41 pm
Please log in for more thread options
> Hi.
>
> I'd like a little help working out what is going on with what should
> be a simple alignment problem.
>
> I have an outer table with a <td> which has an inner table.
>
> The <td> specified as width=200 has the inner table which is
> width=100%
>
> But I can't make the inner table appear as 100% the width of the cell
> unless the cell is at least half the width of the outer table.
>
> If this is normal behaviour, why is it like that? It kinda defies my
> view of logic.
>
>
>
> <body>
>
> <table width="780" border="1">
> <tr>
> <td width="200">
>
> <table bgcolor="#FF0000" width="100%" border="1">
> <tr>
> <td>&nbsp;</td>
> <td>&nbsp;</td>
> </tr>
> </table>
>
> </td>
> <td width="394">&nbsp;</td>
> </tr>
> </table>
>
> </body>

I think you'll find the behaviour is browser-dependent. Firefox behaves the
way you expected, IE doesn't.
--
David Biddulph




Posted by Steve Pugh on January 30, 2005, 12:55 pm
Please log in for more thread options

>I have an outer table with a <td> which has an inner table.

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

>The <td> specified as width=200 has the inner table which is
>width=100%
>
>But I can't make the inner table appear as 100% the width of the cell
>unless the cell is at least half the width of the outer table.
>
><table width="780" border="1">
>        <tr>
>                <td width="200">
>                <table bgcolor="#FF0000" width="100%" border="1">
>                        <tr>
>                                <td>&nbsp;</td>
>                                <td>&nbsp;</td>
>                        </tr>
>                </table>
>                </td>
>                <td width="394">&nbsp;</td>
>        </tr>
></table>

200 + 394 = 594
594 < 780
How is the browser supposed to lay out the main table?

There are a few guidelines to remember:
* cell widths are just suggestions, browsers should ignore them if the
content doesn't fit.
* table widths tend to be given higher priority then cell widths

What I think IE is doing is that it is setting the inner table to be
200px wide, 100% of 200px is 200px. But because 594 != 780 it is then
adjusting the widths of the outer table cells to meet the specified
table width. But it is not keeping the width of the inner table to the
previously defined amount.

        Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor



Similar ThreadsPosted
DIV Alignment problem October 12, 2008, 10:41 am
Vertical alignment of table cell contents in FireFox August 27, 2006, 5:55 am
Problem with table width? July 19, 2004, 10:45 pm
table percentage problem August 20, 2004, 10:11 am
Table widths problem October 6, 2004, 11:40 pm
Problem with TABLE WIDTH January 5, 2005, 6:53 pm
Problem with table 100% width June 8, 2005, 8:18 am
Problem With Button In Table September 2, 2005, 12:08 pm
Re: html table problem February 6, 2006, 5:59 pm
table: valign-top problem February 15, 2008, 3:50 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap