Author |
Topic  |
|
laser
Advanced Member
    
Australia
3859 Posts |
Posted - 16 October 2004 : 09:17:05
|
OK, here's a coding question for you ;)
I have a 3 column table ; middle column is 468 pixels wide ; the side ones must be the same size and must cater for diff res screeens and resizing screen. Always using as much real estate as possible, but not creating any horizontal scroll bars
Any ideas on how to do this using tables ? (I'm sure it can be done in frames, but I don't want to use frames) |
|
D3mon
Senior Member
   
United Kingdom
1685 Posts |
|
laser
Advanced Member
    
Australia
3859 Posts |
Posted - 16 October 2004 : 17:35:23
|
Yeah, I tried that but it didn't seem to work. I've got a few more ideas to try out though. |
 |
|
Roland
Advanced Member
    
Netherlands
9335 Posts |
Posted - 16 October 2004 : 17:59:09
|
Why don't you combine the three columns and insert another table at the fixed width, centered in the column? Okay, nested tables stink, but it never fails :) |
 |
|
laser
Advanced Member
    
Australia
3859 Posts |
Posted - 16 October 2004 : 18:18:17
|
Would that work if the left & right cells needed to have a different bgcolor ? I know I didn't say this to begin with, but my aim is to have (what looks like) a seamless banner across the whole table. The image in the middle has a blend going across, so the left table cell has the bgcolor to match the left side of the image, and the right table cell has a bgcolor to match the right side of the image.
I've resorted to DreamWeaver, which reckons this will work :
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
<td width="468"> </td>
<td> </td>
</tr>
but it doesn't, and if I make the variable width cells 50% I get a horizontal scroll bar at 800x600 |
 |
|
zinpin
Junior Member
 
Australia
202 Posts |
Posted - 16 October 2004 : 18:41:08
|
maybe this will help laser
<table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="33%" bgcolor="red"> </td> <td width="468" bgcolor="white">Main table...</td> <td width="33%" bgcolor="red"> </td> </tr> </table>
|
Edited by - zinpin on 16 October 2004 18:48:13 |
 |
|
Roland
Advanced Member
    
Netherlands
9335 Posts |
Posted - 16 October 2004 : 18:47:03
|
33% might not be enough if the 468 pixels for the center column aren't 33% or more of the entire screen width, like on monitors set to 1600x1200. I'll have to play around with a test file tomorrow to see what will work. |
 |
|
laser
Advanced Member
    
Australia
3859 Posts |
Posted - 16 October 2004 : 18:52:23
|
Thanks zinpin, I've done basically the same thing from scratch and it works like a charm. Where I want it to work (a customised MaxWebPortal header) I can't get it the same so it's more the CSS (etc..) in there rather than the underlying HTML
Thanks for the help anyway, always appreciated  |
 |
|
Roland
Advanced Member
    
Netherlands
9335 Posts |
Posted - 16 October 2004 : 19:00:40
|
You know, I just made a simple test file, and it only works when I don't enter a width for the left and right columns. If I set a percentage it ignores the pixel width of the center column, either making it smaller or wider. |
 |
|
laser
Advanced Member
    
Australia
3859 Posts |
Posted - 16 October 2004 : 19:18:31
|
Thanks guys for the help  The key to fixing it was another row further down that was obviously having some influence. As soon as I added a </table><table> after the first row it worked like I expected it to.
The key things were :
- must specify table as 100% - no widths in the left & right cells - nbsp in the left & right cells - hardcode the middle cell width
Now, off to do some other things I promised .... |
 |
|
|
Topic  |
|