Forum Moderators: open

Message Too Old, No Replies

Simple Problem with colspan in Opera and IE

         

sedovds

12:55 pm on Oct 25, 2007 (gmt 0)

10+ Year Member



Well, stripping all the staff out I isolated problem to this:

<table width="100%" border="0" cellspacing="1" cellpadding="4">
<tr>
<td colspan="2">#*$!#*$!x #*$!#*$!#*$!#*$!#*$!#*$!#*$!#*$!#*$!x #*$!#*$!#*$!#*$!#*$!#*$!#*$!#*$!#*$!#*$!#*$!#*$!#*$!#*$!</td>
</tr>
<tr>
<td width="200">&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>

For some reason if width="200" resizes to aproximate width of the text (bunch of "x"s) and does not stay 200. In Firefox everything works fine though

sedovds

12:57 pm on Oct 25, 2007 (gmt 0)

10+ Year Member



for some reason in my last post all "x"'s got replaced with "$!#"
Anyways, if you just type in bunch of text in there the table with width 200 will resize to aprox. the length of that text. How can I overcome this. (In the site matter I HAVE to use that colspan)

Marshall

2:21 pm on Oct 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hello sedovds and welcome to WebmasterWorld.

Your problem stems from the second cell without a width setting. It will shrink with the insertion of text in your first row. In other words, the 200px cell is the dominate one.

One solution is to apply a width of say 90% to the second cell. This will force that cell to maximize the space save the 200px from the first cell.

Depending on your doctype, width="200px" is a depreciated tag. You may want to consider changing it to style="width: 200px;" It will not solve you problem, but it is better coding. This would apply too to my suggestion about the second cell style="width: 90%;"

Marshall

sedovds

6:55 am on Oct 26, 2007 (gmt 0)

10+ Year Member



Thanks a lot.

Actually I am in process of reprogramming the whole site with CSS, which makes a lot of sense.

The whole table is supposed to fill out the browser width, thats why I left it without any width params. So as far as I understand, making something like this is impossible in HTML. "90%" might not work on all resolutions. I.e. on big resolutions "90%" might be smaller then the width of the screen minus 200px, thus resulting in a 200px cell still becoming bigger.

Marshall

1:07 pm on Oct 26, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You could always make it 99%.

Marshall