peg the height of a table to 90% of the screen

P

Phlip

HTMLers:

Start with this simple HTML:

<table border='1' width='100%' height='90%'>
<tr><td>
<div style='overflow: auto'>
</div>
</td></tr>
</table>

What does it look like it will do? If the table sets the rules and its
inside things follow, then the table should peg to 100% by 90%, right?

The goal is the <div> gets a scroll bar so its internals are always in
a viewport inside the screen.

So now put your cursor inside the <div>, and paste all this in:

http://etext.virginia.edu/stc/Coleridge/poems/Rime_Ancient_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.

What's the fix? I don't want to peg the table to height: 45ex, for
example, because I target any resolution.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,444
Messages
2,571,709
Members
48,796
Latest member
Greg L.
Top