IE screws up table cell widths when colspan is used

G

Glen K

If I veiw the following HTML in IE 5 or 6:

<table>
<tr> <td colspan="2">
________________________CELL1_____________________
</td></tr>
<tr><td style="background-color: green;width:100px;">
CELL2
</td>
<td>
CELL3
</td></tr>
</table>

The columns with CELL2 comes out a lot wider than 100px. As a matter of
fact, I've tried experimenting with different widths and it looks like
it's adding the specified width to half the width of the "CELL1" cell.
It looks OK in Firefox, so is this some kind of bug or am I missing
something?
 
S

Stephen

In Glen K <[email protected]> expounded:
| If I veiw the following HTML in IE 5 or 6:
|
| <table>
| <tr> <td colspan="2">
| ________________________CELL1_____________________
| </td></tr>
| <tr><td style="background-color: green;width:100px;">
| CELL2
| </td>
| <td>
| CELL3
| </td></tr>
| </table>
|
| The columns with CELL2 comes out a lot wider than 100px. As a matter
| of fact, I've tried experimenting with different widths and it looks
| like it's adding the specified width to half the width of the "CELL1"
| cell. It looks OK in Firefox, so is this some kind of bug or am I
| missing something?

It does for me, too. I noticed that your content line in HTML is 380px long.
That is taken to be colspan x 2 apparently. While FF and NS heed the width
of the td in cell 2, IE does not. Try making your content line 200 px wide
and make the td width for cell 2 50%. It appears right in all three. I'm
guessing IE bug.

<table>
<tr> <td colspan="2">
_______________________CELl 1__ (make this 200px)
</td></tr>
<tr><td style="background-color: green;width:50%;">
CELL2
</td>
<td>
CELL3
</td></tr>
</table>
 
R

rf

Glen K said:
If I veiw the following HTML in IE 5 or 6:

<table>
<tr> <td colspan="2">
________________________CELL1_____________________
</td></tr>
<tr><td style="background-color: green;width:100px;">
CELL2
</td>
<td>
CELL3
</td></tr>
</table>

The columns with CELL2 comes out a lot wider than 100px. As a matter of
fact, I've tried experimenting with different widths and it looks like
it's adding the specified width to half the width of the "CELL1" cell.
It looks OK in Firefox, so is this some kind of bug or am I missing
something?

Known bug. IE figures out how much leftover space it has from the colspanned
cell and apportions that space over the other cells, in addition to your
width.
 
G

Glen K

Glen K said:
[quoted text muted]

Known bug. IE figures out how much leftover space it has from the colspanned
cell and apportions that space over the other cells, in addition to your
width.

Is there any work-around for this? I want to create a web page with a
banner image across the top and a fixed width menu bar on the left and the
main content on the right. I'd like to avoid using <DIV>'s since it a
pain to try and get them to look the way you want.
 
P

PeterMcC

Glen K wrote in
Glen K said:
[quoted text muted]

Known bug. IE figures out how much leftover space it has from the
colspanned cell and apportions that space over the other cells, in
addition to your width.

Is there any work-around for this? I want to create a web page with a
banner image across the top and a fixed width menu bar on the left
and the main content on the right. I'd like to avoid using <DIV>'s
since it a pain to try and get them to look the way you want.

I'm surprised at that but YMMV - I'd suggest a look at:
http://bluerobot.com/web/layouts/layout1.html
http://www.benmeadowcroft.com/webdev/template_1_3/template.html

Both offer what you seem to be wanting.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top