Link to home
Start Free TrialLog in
Avatar of TeleKawaru
TeleKawaru

asked on

Table cells resize themselves even though a width has been specified.

I have this page here
http://glwb.net/tvguide.php
which looks pretty much how I want it to. I have specified all of the cell widths so they are appearing pretty much the same between browsers.

When I actually populate the text:
http://glwb.net/tvguide.php?showtext=1
The table cells change their size and it's not from a really long word.

Any ideas?
ASKER CERTIFIED SOLUTION
Avatar of softplus
softplus

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of TeleKawaru
TeleKawaru

ASKER

I did make them each their own table but they didn't line up properly at all. Sometimes there would be a single row that was longer than the rest. =/
I have another idea, but I'm not sure if it works :)
- Make one table around the whole table with a fixed width, i.e. not with Width=100%
- For each row, make a new table with a fixed width (probably 2 px less than the main table).
- Do not use Colspan within the table, but rather give the columns just a fixed pixel width

something like this:
<table width="800px">
<!-- each row -->
<table width="798px">
<tr><td width="94px">content 1</td>
<td width="704px">content 2</td></tr>
</table>
<!-- next row -->
<table width="798px">
<tr><td width="155px">content 1</td>
<td width="233px">content 2</td></tr>
<td width="410px">content 3</td></tr>
</table>
<!-- end -->
</table>

You just need to make sure the widths add up with the borders you're using :). I assume the colspan is a part of the problem, as you are telling the browser that it's actually a bunch of columns + it wants to spread it evenly. If you do each line by itself and specify the exact width, maybe it will work better. BUT you will still have problems if you have long words which are wider than the column width; this will cause the one line to be longer than the rest and will look "ugly". This problem is compounded when the user overrides your font settings (i.e. the user has bad vision and uses much larger fonts - but in this case they are usually used to having the sites look differently :)).

Another possibility would be to render the column on the server and pass it as a graphic to the user. However, this uses quite a bit of "processing power" (+ code) and probably more bandwidth.

Just an idea, it's kind of hard for me to test without the full content you have :)
John
I changed it to 15 minutes increments and it worked perfectly! Thanks!
Glad to see it work, I'll have to check what shows are on now :))