473,396 Members | 1,713 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,396 software developers and data experts.

table width layout problems in IE

I have the following problem:
I need a simple, tabular layout in a webshop.
- left column: navigation column with approx. 170px width
- right column: content area

the goal: the left column should contain a few "boxes" (these are HTML-
tables) which should be all of the same width.

So, I attributed the left column with 'width="170"' and assigned the
attribute 'width="100%"' to all contained <table>s. This should
guarantee that the <table>s fill up the entire table column space.

The problem:
If some content of one of the <table>s is wider than 170px and thus
forces the entire left column to be wider than 170px, then all other
<table>s are shown STILL WITH A WIDTH OF 170px, thus not consuming the
available space (suggested by width=100%) but just consuming 170px.

The culprit in my sample HTML code (see below) is the table cell with
the "nowrap" attribute, which contains a phone number. It is the cell
shown with a light green background.

MY QUESTION:
How can I force IE (version 5.5) to display all <table>s in the left
column with the same width, that is, the width of 170px - or the width
of the widest table width, if it is wider than 170px and thus forces the
column width to be wider than 170px?

In Firefox it looks perfectly, but in the IE...

Thanx for all useful hints!
Alex
Here is my sample HTML code:

<html>
<body>
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#0099cc" width="170" valign="top">
<table width="100%" border="0">
<tr>
<td bgcolor="#008000">
This cell should be very next to the next cell (the right one,
with the same dark green background), with no pixel in between.
</td>
</tr>
</table>
<br>
<table width="100%" border="0">
<tr>
<td bgcolor="#ff2020">HEADING 1 - this heading should span the
whole width of the table column with the blue background color</td>
</tr>
<tr>
<td class="serviceBg"> This is just ordinary text, really
really ordinary
text, indeed very ordinary - this is just ordinary text,
well, it
is quite ordinary, yes it is. </td>
</tr>
</table>
<br>
<table width="100%" border="0">
<tr>
<td bgcolor="#ff2020">HEADING 2</td>
</tr>
<tr>
<td bgcolor="#00ff33">
<table border="0">
<tr>
<td nowrap="nowrap">
Phone: 0666 65465464564564565
<br>
This is the culprit!
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
</td>
<td bgcolor="#008000" nowrap>Content area...</td>
</tr>
</table>
</body>
</html>

--
remove underscore+nospam if you want to mail me
Jul 24 '05 #1
4 6131
You have nested a table within another table within a higher
table. Some visual browsers have trouble with that. So do many
audio browsers for the visually handicapped.

Since you are not trying to present tabular information, try doing
this without tables. You can create a similar effect with
style-sheets that define columns with nested boxes.

By the way, be careful with colors. For example, the dark-green
background is not good for black text. I can read it, but it's not
sharp. Others might have trouble.

--

David E. Ross
<URL:http://www.rossde.com/>

I use Mozilla as my Web browser because I want a browser that
complies with Web standards. See <URL:http://www.mozilla.org/>.
Jul 24 '05 #2
Take a look at <URL:http://www.rossde.com/test/cols_n_boxes.html>.
It uses CSS1 to create the column with colored boxes on the left.
This does not exactly replicate the way your page looks with
Mozilla, but it might reflect your intent.

I validated this for both HTML and CSS. Your example lacked a
<HEAD> section, which is where I put most of the CSS.

Since this is now valid HTML and CSS, if IE doesn't display it
correctly, that's an IE bug and Micro$oft's problem. My philosophy
is that you should follow the W3C specifications and not worry
about browser bugs. Web pages should not be made non-compliant
merely to compensate for such bugs.

--

David E. Ross
<URL:http://www.rossde.com/>

I use Mozilla as my Web browser because I want a browser that
complies with Web standards. See <URL:http://www.mozilla.org/>.
Jul 24 '05 #3
no****@nowhere.not says...
You have nested a table within another table within a higher
table. Some visual browsers have trouble with that. So do many
audio browsers for the visually handicapped.
Ugh, I thought that working with tables to structure the layout (not
pixel-wise, but semantically) would be the preferred and most compatible
way...
Since you are not trying to present tabular information, try doing
this without tables. You can create a similar effect with
style-sheets that define columns with nested boxes.
Could you point me in the right direction? Do you mean these "float"ing
DIV stuff? I'm afraid I'm not at all familiar with these. Or what do you
mean by "nested boxes"? CSS is in general no problem for me, but I have
only dug into CSS to a intermediate level.

By the way, be careful with colors. For example, the dark-green
background is not good for black text. I can read it, but it's not
sharp. Others might have trouble.


You are right, but these ugly colors were just for presentation purposes
of the problem.

Alex

--
remove underscore+nospam if you want to mail me
Jul 24 '05 #4
In article <42***************@nowhere.not>, no****@nowhere.not says...
Take a look at <URL:http://www.rossde.com/test/cols_n_boxes.html>.
It uses CSS1 to create the column with colored boxes on the left.
This does not exactly replicate the way your page looks with
Mozilla, but it might reflect your intent.
Thanx a lot, I will have a in-depth look into your page!
I validated this for both HTML and CSS. Your example lacked a
<HEAD> section, which is where I put most of the CSS.
I omitted the <HEAD> section, again, for illustrating purposes only.

Since this is now valid HTML and CSS, if IE doesn't display it
correctly, that's an IE bug and Micro$oft's problem. My philosophy
is that you should follow the W3C specifications and not worry
about browser bugs. Web pages should not be made non-compliant
merely to compensate for such bugs.


Well, I can follow your point, I am also one of the persons cursing the
IE for both not complying to the W3C specs and being the widest spread
browser so far (hope this is changing soon...). However, since my
customer insists in having the page look ok in IE, I can't ignore this
fact. So, I just have to get the page right, even with the sucking IE.

Cheers,
Alex
Jul 24 '05 #5

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

Similar topics

61
by: Toby Austin | last post by:
I'm trying to replace <table>s with <div>s as much as possible. However, I can't figure out how to do the following… <table> <tr> <td valign="top" width="100%">some data that will...
15
by: Holly | last post by:
I'm trying to get this page to look the same in Netscape and IE. I have a box that says 'Upcoming Events' on the lower left of the page. It's supposed to have a gray background, but in NS 4.x it...
28
by: Anthony Williams | last post by:
Good morning, I'm currently designing a site, using CSS, and wish to create a variable width two-column layout, with header and footer, and one fixed-width column on the left. Previously, I...
4
by: Bernd Goldschmidt | last post by:
Hi. I've got a somewhat wired problems with an extra space between table rows in Mozilla and Opera (IE works fine). With the code below, cells within a row align seamlessly, but there is a...
16
by: Michael Rozdoba | last post by:
I'm far from a CSS expert, but what I see of it I really like & I love keeping content & style separate. I also hate the way table layout produces convoluted bulky code. However when asked why...
5
by: Jean Pion | last post by:
Dear readers, Can anyone explain how to set column width of a table in ccs. I use the following style in an external stylesheet: table.tbl { table-layout:fixed; border-top: 5px solid #333;...
4
by: Arthur Dent | last post by:
Hello all... i have a really frsutrating problem here... This is only happening in IE (6 & 7b2), Mozilla and Netscape are both OK. I have a top-level table with a width of 760px, so it should be...
117
by: phil-news-nospam | last post by:
Is there really any advantage to using DIV elements with float style properies, vs. the old method of TABLE and TR and TD? I'm finding that by using DIV, it still involves the same number of...
1
by: Robert | last post by:
Probably something simple i'm overlooking, taking the below html and css style settings, when you view in a browser (IE or Mozilla for example), the table is a tiny bit less wide than the div. Yet...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...

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.