You are here: peg the height of a table to 90% of the screen « HTML « IT news, forums, messages
peg the height of a table to 90% of the screen

Posted by Phlip on 02/23/07 03:16

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.

--
Phlip

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация