PDA

View Full Version : Restrict table height / Prevent cell auto-expand


m__
05-14-2003, 04:19 AM
Preface:
- I've (quickly) searched the forum, but cannot find an answer to my question.
- Yes, I'm using tables for layout purposes. I'm not looking for a dissertation on why this is bad. I'll stop using tables for layout purposes when vBulletin stops. ;)

Question:
Is there a way to restrict a table cell's height other than the height attribute (which doesn't seem to work in IE)?

In other words:
How can I prevent a table from auto-expanding to fill space?

m__
05-14-2003, 05:34 AM
Forget it. I've resorted to about a million embedded tables. It sucks, but it kind of works.

Here's an article which describes the problem more accurately than I have, if anyone is interested:

http://builder.cnet.com/webbuilding/pages/Authoring/AdvHtml/ss01c.html

brothercake
05-14-2003, 12:49 PM
This doesn't work in IE, but you can restrict dimensions with CSS:

element { max-width:100px; max-height:100px; }

Can't remember what happens to content which is too large and can't be compressed - I think it hangs over the edge.

Alternatively, you have overflow and clip, which does work in IE as well:

element { overflow:hidden; clip:rect(0,100px,100px,0); }

For overflow you can specify "hidden" or "scroll" (or "visible", but that's the same as default)

whackaxe
05-14-2003, 03:50 PM
well alteritaly you could have a <textarea> in your cell with invisible borders. a bit extreme though