Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > IE screws up table cell widths when colspan is used

Reply
Thread Tools

IE screws up table cell widths when colspan is used

 
 
Glen K
Guest
Posts: n/a
 
      07-13-2004
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?
 
Reply With Quote
 
 
 
 
Stephen
Guest
Posts: n/a
 
      07-13-2004
In news(E-Mail Removed),
Glen K <(E-Mail Removed)> 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>


--

stephen


 
Reply With Quote
 
 
 
 
rf
Guest
Posts: n/a
 
      07-13-2004

"Glen K" <(E-Mail Removed)> wrote in message
news(E-Mail Removed)...
> 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.

--
Cheers
Richard.


 
Reply With Quote
 
Glen K
Guest
Posts: n/a
 
      07-14-2004
On Tue, 13 Jul 2004 23:57:58 +0000, rf wrote:

>
> "Glen K" <(E-Mail Removed)> wrote in message
> news(E-Mail Removed)...
>> [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.

 
Reply With Quote
 
PeterMcC
Guest
Posts: n/a
 
      07-14-2004
Glen K wrote in
<(E-Mail Removed)>

> On Tue, 13 Jul 2004 23:57:58 +0000, rf wrote:
>
>>
>> "Glen K" <(E-Mail Removed)> wrote in message
>> news(E-Mail Removed)...
>>> [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.html

Both offer what you seem to be wanting.

--
PeterMcC
If you feel that any of the above is incorrect,
inappropriate or offensive in any way,
please ignore it and accept my apologies.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to assign colspan to a table cell in javascript manoj Javascript 1 02-25-2008 11:39 AM
Table with Alternating Color Columns and Colspan cho.cabot HTML 3 11-13-2006 02:53 PM
Colspan - rowspan HTML Table Logix HTML 23 08-27-2004 09:28 PM
Unable to set server side table's cell widths as percentages Dot net work ASP .Net 2 05-20-2004 12:56 PM
asp:table equivalent of colspan??? rob merritt ASP .Net Web Controls 1 04-18-2004 08:48 AM



Advertisments