HTML 4.01 strict - table how to

  • Thread starter Christophe Darville
  • Start date
C

Christophe Darville

Hello,

I want to move my html pages to be html 4.01 standard (strict mode).

I run into the following problem with a table (having 2 rows).

I want my table to take up the whole page (height and width = 100%).

I want my first row to take up exactly 60px.

I want my second row to take up the rest of the page.

In quirk mode, I was able to do this by using attribute height="*" for the
second row, but in html 4.01, I do not find a way to make it works.

I have tried something like (and many other things) :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html style="margin:0;padding:0;height:100%">
<head></head>
<body style="margin:0;padding:0;height:100%">
<table border="1" CELLPADDING="0" CELLSPACING="0"
style="height:100%;width:100%">
<tr style="height:60px">
<td style="height:60px">menu</td>
</tr>
<tr style="height:*">
<td style="height:*">body</td>
</tr>
</table>
</body>
</html>

Any idea ?

Thank you,
Christophe
 
D

DU

Christophe said:
Hello,

I want to move my html pages to be html 4.01 standard (strict mode).

I run into the following problem with a table (having 2 rows).

Why a table design? Tables should be used only for tabular data. Use
I want my table to take up the whole page (height and width = 100%).

What's so wrong with a vertical scrollbar when it is needed to access a
long document? What's so wrong if your document content overflows the
user's browser viewport dimensions... which you can not control by the
way...
I want my first row to take up exactly 60px.

I want my second row to take up the rest of the page.

In quirk mode, I was able to do this by using attribute height="*" for the
second row, but in html 4.01, I do not find a way to make it works.

I have tried something like (and many other things) :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html style="margin:0;padding:0;height:100%">

html never has margin nor padding in all W3C web standards compliant
browsers. MSIE 5+ has a medium inset border though.
<head></head>
<body style="margin:0;padding:0;height:100%">
<table border="1" CELLPADDING="0" CELLSPACING="0"
style="height:100%;width:100%">
<tr style="height:60px">
<td style="height:60px">menu</td>
</tr>
<tr style="height:*">
<td style="height:*">body</td>
</tr>
</table>
</body>
</html>

Any idea ?

Thank you,
Christophe

What is you real web page and real web page context, situation exactly?
It looks to me that you are trying to fix a problem related to your
webpage with an assumed (table-based design) solution instead of first
presenting what is the real issue here. Be open-minded, flexible!

DU
 
B

Barry Pearson

Christophe said:
Hello,

I want to move my html pages to be html 4.01 standard (strict mode).

I run into the following problem with a table (having 2 rows).

I want my table to take up the whole page (height and width = 100%).
[snip]

This is very hard cross-browser & Strict. I have been unable to make it work
for IE Mac. (I think there are scripts which would do it for you. I was trying
to do it purely with valid 4.01 Strict & CSS2. And I still ended up with some
script to cause Opera to reload the page if the user resized the viewport!)

Here is the best I could achieve:

http://www.barry.pearson.name/articles/table_pages/single_cell.htm
http://www.barry.pearson.name/articles/table_pages/single_cell.css

There are actually 3 different things being demonstrated on that page, all of
them using single-cell tables:
1. Stretching a table to the height of the viewport.
2. Achieving the effect of a max-width column, even in IE.
3. Having a better approach to a flexible centre column between floated
sidebars than using wide left & right margins, even in IE.

You want the outer-most table, and the corresponding CSS:
body
#verticaldiv
#verticaltable
#verticalcell
 

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
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top