full screen table

liunx

Guest
Hi!<br />
<br />
I'm trying to desing a site so it adjust to the window. The problem is that I want three cols having borders of 1px and NS4 just gets its width almost randomly. <br />
Ok, I'm not explaining myself very well so here's the code:<br />
<br />
______________________________________________<br />
<html><br />
<body><br />
<table width="100%" border=0 cellpadding=0 cellspacing=0><br />
<tr><br />
<td bgcolor="#000000"><img src=http://www.htmlforums.com/archive/index.php/"img/spacer.gif" width=1 height=100></td><br />
<td bgcolor="#FF0000"><img src=http://www.htmlforums.com/archive/index.php/"img/spacer.gif" width=150 height=100></td><br />
<td bgcolor="#000000"><img src=http://www.htmlforums.com/archive/index.php/"img/spacer.gif" width=1 height=100></td><br />
<td><img src=http://www.htmlforums.com/archive/index.php/"img/spacer.gif" width=2 height=1></td><br />
<td bgcolor="#000000"><img src=http://www.htmlforums.com/archive/index.php/"img/spacer.gif" width=1 height=100></td><br />
<td width=100% bgcolor="#00FF00"><img src=http://www.htmlforums.com/archive/index.php/"img/spacer.gif" width=1 height=100></td><br />
<td bgcolor="#000000"><img src=http://www.htmlforums.com/archive/index.php/"img/spacer.gif" width=1 height=100></td><br />
<td><img src=http://www.htmlforums.com/archive/index.php/"img/spacer.gif" width=2 height=1></td><br />
<td bgcolor="#000000"><img src=http://www.htmlforums.com/archive/index.php/"img/spacer.gif" width=1 height=100></td><br />
<td bgcolor="#0000FF"><img src=http://www.htmlforums.com/archive/index.php/"img/spacer.gif" width=100 height=100></td><br />
<td bgcolor="#000000"><img src=http://www.htmlforums.com/archive/index.php/"img/spacer.gif" width=1 height=100></td><br />
</tr><br />
</table><br />
</table><br />
</body><br />
</html><br />
______________________________________________<br />
<br />
Any help would be great. Thanks in advance :)<!--content-->I guess the problem is than NS4 doesn't like the "<td width=100%>" so I've tried to substitute that percent width with a very high pixel width. <br />
<br />
In normal conditions it's supossed that if I put something like "<td width=10000>" the browser would display a huge scrolling bar but since the table has "width=100%" it doesn't appear a scrollbar at all!<br />
<br />
Check it! It has worked for me. Here, the new code:<br />
<br />
___________________________________________________________<br />
<html> <br />
<body> <br />
<table width="100%" border=0 cellpadding=0 cellspacing=0> <br />
<tr> <br />
<td bgcolor="#000000"><img src=http://www.htmlforums.com/archive/index.php/"img/spacer.gif" width=1 height=100></td> <br />
<td bgcolor="#FF0000"><img src=http://www.htmlforums.com/archive/index.php/"img/spacer.gif" width=150 height=100></td> <br />
<td bgcolor="#000000"><img src=http://www.htmlforums.com/archive/index.php/"img/spacer.gif" width=1 height=100></td> <br />
<td><img src=http://www.htmlforums.com/archive/index.php/"img/spacer.gif" width=2 height=1></td> <br />
<td bgcolor="#000000"><img src=http://www.htmlforums.com/archive/index.php/"img/spacer.gif" width=1 height=100></td> <br />
<td width=10000 bgcolor="#00FF00"><img src=http://www.htmlforums.com/archive/index.php/"img/spacer.gif" width=1 height=100></td> <br />
<td bgcolor="#000000"><img src=http://www.htmlforums.com/archive/index.php/"img/spacer.gif" width=1 height=100></td> <br />
<td><img src=http://www.htmlforums.com/archive/index.php/"img/spacer.gif" width=2 height=1></td> <br />
<td bgcolor="#000000"><img src=http://www.htmlforums.com/archive/index.php/"img/spacer.gif" width=1 height=100></td> <br />
<td bgcolor="#0000FF"><img src=http://www.htmlforums.com/archive/index.php/"img/spacer.gif" width=100 height=100></td> <br />
<td bgcolor="#000000"><img src=http://www.htmlforums.com/archive/index.php/"img/spacer.gif" width=1 height=100></td> <br />
</tr> <br />
</table> <br />
</body> <br />
</html> <br />
___________________________________________________________<!--content-->I'm a little confused. all you did was made a cell the same size that had a img in it and did nothing. it will only be as big as the img is anyway.<br />
<br />
<td width=10000 bgcolor="#00FF00"><img src=http://www.htmlforums.com/archive/index.php/"img/spacer.gif" width=1 height=100></td> <br />
<br />
<br />
make it 100% and it looks the same. I never have problems with NS4.x and td width=100%<br />
<br />
if you want to have the table so it sets up correctly in all window sizes just make the middle cell a % and a fixed cell width for the 2 outer ones. that way it stays the same as teh middle contracts or expands.<!--content-->Hi!<br />
<br />
The problem is that if I want to have more than 3 columns in that "fixed % fixed way" NS wont render it correctly.<br />
At least it haven't done for me. I mean: I want three cols having 1px border each one. I want that borders to expand all the height of each column (so thats why I haven't used a nested table inside the fixed width tables). <br />
<br />
Well, my desired layout would be then:<br />
<br />
px(border) | px(contents) | px(border)<br />
for the side tables and:<br />
<br />
px(border) | %(main contents) | px(border)<br />
for the middle table.<br />
<br />
The problem comes when I use the 100% in the middle table (main contents). NS4 (NS6 renders correctly) wont allow me to have the 1px borders and instead would make then like 8 or more pixels wide.<br />
<br />
Test the first code I posted to see what I mean. First look how IE renders it (the correct layout) and then how NS4 do it. I can send you a screenshot if you like :)<br />
<br />
I know my workaround is not the best but actually is the only one that has worked for me and also the one with less code adittion (just 6 chars! :))<br />
<br />
C ya!<!--content-->Hi again!<br />
<br />
Well, at least my code didn't work because the middle cell finally got 10000 pixels wide when inserted a nested 100% table inside :P<br />
<br />
So I checked again with a 100% cell in the middle and this time it worked! Seems that the problem comes when the content inside the 100% middle cell does not fill it completely. Damned NS4, I hope it'll day soon *lol*<br />
<br />
Thanks anyway, bye<!--content-->
 
Back
Top