473,549 Members | 2,247 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

table alignment problem

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="#FF000 0" width="100%" border="1">
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>

</td>
<td width="394">&nb sp;</td>
</tr>
</table>

</body>

Jul 23 '05 #1
2 2867
"Andy Flash" <An************ *@tpg.com.au> wrote in message
news:k2******** *************** *********@4ax.c om...
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="#FF000 0" width="100%" border="1">
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>

</td>
<td width="394">&nb sp;</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
Jul 23 '05 #2
Andy Flash <An************ *@tpg.com.au> wrote:
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="#FF000 0" width="100%" border="1">
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</td>
<td width="394">&nb sp;</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

Steve Pugh <st***@pugh.net > <http://steve.pugh.net/>
Jul 23 '05 #3

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

Similar topics

8
2727
by: DonLi | last post by:
Hi, I'm having a problem with a table alignment, it won't top-align. Background info: above the table, a dozen lines of js code and a bit of programming code, none has HTML space-taking code like <br> or <p> etc. Tons of logic inside the TABLE, in and out of TR, but all TRs are closed properly and have same number of TD, which are also...
1
2086
by: Eric | last post by:
Hello, I'm sure your all tired of these "alignment" question, but please endure mine. Question. Simple put: What makes a table sit beside another table, as oppose to going down below it. Here's my example ... <html>
5
4721
by: Harry | last post by:
CSS Description: Table contains a column of td cells with links. Achieved: 1. Entire link cells highlight when hovered. 2. The entire area of these cells are clickable. Problem:
2
3729
by: googley | last post by:
I'm starting a new thread for a problem that I ran into.. I'm trying to use STYLE SHEETS/CSS to update multiple table widths across many pages. I did get it working with one small problem that I can't figure out. For the sake of being really simple here are the steps i took. 1. create blank web page, create blank css page. 2. save 'em...
3
4931
by: ben.saur | last post by:
I am having a problem viewing a centered table using Firefox. When the page is long enough to scroll, the alignment moves slightly to the left. The alignment doesn't change when I view the page with IE. Here is the code: Table 1: <table width="100%"> <tr><td > <div align="center"> <table border="1" style="width:800; margin-left:auto;
7
1936
by: Jef Driesen | last post by:
How can I replace/override the table attributes align, border, cellpadding and cellspacing with css?
7
15669
by: Allie | last post by:
Here's an example of what I'm trying to do: <table> <tr style="text-align:left; font-size:10pt; font-weight:bold"> <!-- I want this word to align to the left --> ' ||CRPT|| ' <!-- I want this link to align to the right --> <A HREF=" REPORT?v_rpt='|| v_rpt ||'&v_printable=1'||'">Printable</A> </tr>
7
12052
by: TG | last post by:
hi! I am trying to create a sql server table from an excel sheet. Here is the code I have: 'This procedure the xlsx file and dumps it to a table in SQL Server
3
6661
dmjpro
by: dmjpro | last post by:
I think iText commonly used to create or manipulate PDF document in Java. So finally i decided to throw a question over here. For two days i am struggling. I encountered two types of table .. 1>Table: table can be easily created with row span or col span but still has a problem with vertical alignment of cell content. 2>PdfPTable: table can...
0
7548
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7743
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7504
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7832
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5114
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3499
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1965
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1083
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
786
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.