473,395 Members | 1,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How do I set 1 cell to a fixed height, and the other to the rest of the page? Tables, divs, etc...

The below mangled garbage is a fixed text illustration. I'll try to
describe the problem. This is a general web layout problem I've had
for a while, not confined to this specific case. I would like to have
a block of a fixed size (Say, a DIV on the top of the page of height
100px) and a block filling the rest of the page (in this example, a DIV
with height of PAGE_HEIGHT - 100px).

Is there any way to do this, either cleanly or hacked? Any ideas?

I've tried tables, div's (floats, layers, etc), and even div's with
javascript resizing code. The javascript came close, but had it's own
problems (if a DIV is oversize for any reason, javascript goes into
infinite resize loop).

I've tried this:

<style>
body {
height:100%;
margin:0px;
}
</style>

<table width="100%" height="100%" border="1">
<tr>
<td id="fixed_width" height="100" bgcolor="blue">
<!-- Fixed with top cell -->
</td>
</tr>
<tr>
<td id="rest_of_page" bgcolor="red">
<!-- Expanding bottom cell -->
</td>
</tr>
</table>

No matter what height I put on the bottom cell, it doesn't do what I
want: fill all of the page except the top 100px.

DIV's dont work either. I can have a top DIV of height 100px, but what
is the bottom DIV's height? 100% - 100px, whatever that is.

Any ideas?

-James

- --------------------------- -
| | | |
Whole | | | | 100px
page | | | |
height | --------------------------- - -
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | Remainder
| | | | ( Page height
| | | | -100px)
| | | |
| | | |
- --------------------------- -

Dec 16 '05 #1
0 1614

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: MattB | last post by:
Hello please help, I have a table cell with a div in it. The div has a width of 300px. but when it is rendered it puts extra space into the table cell. Here's the style <style>...
0
by: Paul E Collins | last post by:
Hello. Suppose I use the following code to split a Web page into four separately scrollable quarters, each having 50% page width and 50% page height. Is it then possible to add *fixed*-height...
4
by: Shash | last post by:
Hey People, I'm facing a issue with browser compatablity here, I want a certain group of divs to behave like a table row, i.e if one of the cell/div has content longer than the other divs, all...
4
by: Robert | last post by:
Hi, I am trying to add a background to a cell that contains multiple horizontal coloured layers on top of eachother. I managed to do this in IE, but firefox displays something very different...
3
by: gscott66 | last post by:
Hello, I am fairly new to design and in particular CSS. I have a site with two tables that I cannot seem to get sized correctly. When you view the link, you'll notice that there is a tremendous...
2
by: Eric Lindsay | last post by:
What problems are there in using position: fixed; with left: %; and right: %; to do pages that look like a typical boring framed site. A full width header and a footer and the rest of the content...
0
by: gferris | last post by:
Hello, I am having an issue with a table that I cannot quite figure out. I have a two-column table with the left column comprising of 4 cells and the right column comprising of one cell with a...
4
by: hans.kindberg | last post by:
This is how my page looks like in IE6: http://www.freewebs.com/hasodaki/default.txt (without advertising banner, browsable with IE6 and to see the code with the other browsers)...
3
by: chris f | last post by:
In my table (ASP.NET 2) that is dynamically generated I have a cell that initially will only display N rows of text and hide the rest. (This is so that the rows have a small height and I can...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.