IntelliJ Java IDE
The moose likes HTML, CSS and JavaScript and the fly likes HTML Tables Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "HTML Tables" Watch "HTML Tables" New topic
Author

HTML Tables

Arvind Prabhu
Greenhorn

Joined: Aug 09, 2001
Posts: 18
What's the HTML code for creating a page that contains a header, side nav, main body, and footer using tables. The specs are ...
1. The table should resize automatically to fit the whole window (even through resizes)
2. The header and footer "rows" should be compact and be tall enough to perfectly fit the contents
3. The side nav should take 25% of the width of the window
4. The main body should take 75% of the width of the window, but the height should stretch to take the remaining height of the window (basically main_body_height = window_height - footer_height - header_height)
I've come up with a solution; however, it involves specifying a height for the <tr> tag. And in all HTML references I've seen, <tr> DOES NOT support the height property (?)
Any thoughts?
-Arvind
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15003
You should avoid using tables for layouts, CSS is the way to go!
look at this page:
http://realworldstyle.com/2col.html
I think that is what you are after!
Eric
Winston Smith
Ranch Hand

Joined: Jun 06, 2003
Posts: 136
<TR> does support height, but like Eric said, use CSS. I've made pretty complex pages with nested tables, and when I test these pages across browsers, well, it wasn't pretty. Tables are extremely annoying if you are using them for layout, and you want your page to be compatible with all the major browsers (IE, Netscape, Safari, Mac IE, Firefox, etc.). Also, do yourself a favor, and code a page using CSS...see how much cleaner it is than using tables.
WS


for (int i = today; i < endOfTime; i++) { code(); }
 
 
subject: HTML Tables
 
Threads others viewed
struts2 + Tiles, why pages shrink in top center ?
Tiles Reload problem???
Converting table to divs
Controlling DIV and/or TR height
Table nested inside a div
developer file tools