Click to See Complete Forum and Search --> : help with stretch layout


freshb
01-16-2003, 04:36 PM
Hi, I'm new here and I have a problem I need help with.
The problem revolves around having a header on a website which stretches to meet any screen size. An easy feat with table width settings when you're dealing with no graphics, but unfortunately I am. Let me clarify.
I've got a table which encompasses the whole site, set at 100% width, no margins, no spacing, no padding.
<table border="0" cellspacing="0" cellpadding="0" width="100%", etc.>
<tr><td>
Here, there is an embedded table which will hold the area of difficulty I'm trying to figure out, thus :
<table border="0" cellspacing="0" cellpadding="0" width="100%", etc.>
Now within this secondary table, I've got 1 <tr>, and 5 <td>'s. Here is the problem. ALL FIVE table cells contain graphic files. The first 3 <td>'s contain .gif's that all have a specific width and height, as follows (the names of the files are of course irrelavent, and the width of the file is specified in the cell tag):
<tr>
<td width="200px"><img src="...."></td>
<td width="210px"><img src="...."></td>
<td width="180px"><img src="...."></td>
These cells will never change width and will always form the left hand side of the header. The FOURTH cell is a stretchable image. I will get back to it in one second. The FIFTH and final cell is static. As follows:
<td width="100px"><img src="...."></td>
Now to sum up, my problem is how can I set the FOURTH table cell to be a variable width which stretches to fit the screen dimensions, no matter what the resolution is set at? I will sum up the code below, with "*"'s around the problem area.

<table border="0" cellspacing="0" cellpadding="0" width="100%", etc.>
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="0" width="100%", etc.>
<tr>
<td width="200px"><img src="...."></td>
<td width="210px"><img src="...."></td>
<td width="180px"><img src="...."></td>
****<td><img src="...."></td>****
<td width="100px"><img src="...."></td>
</tr>
</table>
</td>
</tr>
</table>

ANY help on this would be massively appreciated, or if anyone could point me to a resource to help, or another discussion group. I've got a deadline to meet, and this is functionality is mandatory.

Thanks!!!
Brian

jpmoriarty
01-17-2003, 03:49 AM
well i guess you dont realise it but you've answered it yourself - you just dont put a width in, and it will automatically scale it.

However, dont think you're out of the woods yet - by my reckoning your page will need to be at the very least 690 pixels wide, and that's getting a bit big. If your site is on the internet (not an intranet where you can control your viewers) then most will look at the site in 1024 x 768, some in 800 x 600 (and some even lower, but i must admit that i find going lower than that a bit of a stretch). Although you may think that 1024 is sufficiently bigger than 690, if someone has their favourites bar open (as i think most surfers will), then it can very quickly reduce the size of the visible window so that it's no longer enough. and there comes a point where the width=100% will override the pixel settings you've put in, and will reduce the size of those tabel cells that you're trying so hard to protect. Try it and see.

Hope that helps - just thought i'd reply since noone else had yet.