On 23 Feb, 05:24, "Phlip" <phlip2...@gmail.comwrote:
Start with this simple HTML:
<table border='1' width='100%' height='90%'>
<tr><td>
<div style='overflow: auto'>
</div>
</td></tr>
</table>
The table element don't have a height attrubute, and the width
attribute is deprecated. Use
style="width: 100%; height: 90%" insted.
What does it look like it will do?
You are setting the table height to 90% of something, and that
something has a default height of 'auto', then it look like the
browser will let the table grow to accommodate the height of the
content (without some browser magic). The value of 'auto' is initial
comupted to 0.
If the table sets the rules and its
inside things follow, then the table should peg to 100% by 90%, right?
No. 100 % of 90 % of 'auto' is 100% of the content, i think.
The goal is the <divgets a scroll bar so its internals are always in
a viewport inside the screen.
html, body { height: 100%; margin: 0 auto; padding: 0 auto }
....
<div style="height: 90%">...</div>
So now put your cursor inside the <div>, and paste all this in:
http://etext.virginia.edu/stc/Coleri...t_Mariner.html
Not good. The table now sets its size based on the div, which detects
no overflow. Putting height tags in other places doesn't work (in
Firefox). No scroll bar appears, and the poetry overflows the
browser's page.
Yes indeed, not good. To me it seems like Firefox treat fixed height
and calculated height diffrently. With fixed height; the height is
determined by the 'height' property. With an height in %, the height
is determined by content height. I hope I'm wrong.
What's the fix? I don't want to peg the table to height: 45ex, for
example, because I target any resolution.
The browser is schizophrenic. You can't fix that. Do it right, and let
the browser deside how to render it.
If you want, you couldt try a cocktail with relative and absolute
position values.