I have this table setup below, but the “Right Cell, Row 1” is not reducing to minimum height in IE (works in FF); it’s like 65% higher than it should be.
i don’t work with tables any more (barring very simple tables) but it would seem easier to use an external style sheet and restrict the height of the cell by applying a class and using em’s.
Depends on what your DOCTYPE is. If it’s XHTML 1.0 Strict, IE is technically (well, actually it’s not supposed to read xhtml, as it doesn’t deal with text/xml properly) doing its job (td doesn’t have a height attribute in XHTML 1.0 Strict. As fisherboy stated, go with css and see if that works.
from a quick look, it appears to be stretching out because of the cell on the left. If you add content to that left cell, the right side cell will naturally expand. Also the fact that you are using a colspan doesn’t help You will need to look at nesting a table inside that left cell i believe.
AutisticCuckoo,
the cell is actually expanding to about 400px. The cell isnt actually supposed to be 1px high; the 1px high just reduces the cell to minimum height. The cell will end up being about 200-300px high. If someone did want a 1px high cell, they’d need to add “overflow: hidden;”.
all4nerds,
wierd…
Nadia P,
The left cell actually has the most content. It is about 500px high. The colspan is necessary (because that cell spans across the top).
What’s supposed to happen is, the top cell stays minimum height (say 200 pixels) at all times, and the lower one stretches downwards the rest of the way (if the content doesn’t meet the bottom of the page).
Notice the code near the bottom 'style=“height: 10px;”. It is attached to the cell which should be smaller (top right one). I did not import a stylehseet, because it didn’t help the previous time (don’t see why it would now). If anyone thinks i should continue to import, let me know.
In my vary, vary rare case, i cannot nest a table. Sounds insane, but I simply cannot due to a border issue. I could probably use <divs>, but my passionate hate for their flexibility drives me to stick with tables. I have used tables for 4 years, and I’ve got everything to work exactly how I wnated it, eventually.
If anyone has any ideas, please post them. This is starting to drive me nuts.
I don’t know what Y’s height will be, so I need it “auto-stretch” to the bottom; it could be 500 pixels on one page, and 2000 pixels on another. I also want to keep “Z” cell 200 pixels high (and not a pixel higher).
Is there no way to do this? The method you show won’t work because it’s fixed heights. If the heights are enlarged, Y cell will become higher, but Z will also (which is what im trying to stop).
I seriously don’t believe you are going to get a table layout to be pixel perfect anyway. what if someone increases the text in their browser, is your layout going to hold or will it break anyway? (just something to think about
Its the 100% that will push the rest of the cells height back to the height you set it at. Best to use styles too. Let me know if this fixed it for u too.
There are 4 main DTD’s (Document Type Declaration)
HTML Transitional
HTML Strict
XHTML Transitional
XHTML Strict
The DOCTYPE tells the browser how to render the page. A lot of IE bugs can be overcome by choosing a Strict DOCTYPE as it forces IE to adopt a more standards compliant mode. In this case I suspect there is a lot of deprecated (old, to be deleted at some time) markup and it will need to use a Transitional DTD.
IMO, use HTML Strict as much as possible, validate continuously, get it right in FF then fix the few remaining problems in IE.