By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,523 Members | 1,938 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,523 IT Pros & Developers. It's quick & easy.

Table height in percents

P: n/a
Hi,

It seems like HTML 4.01 Transitional spec. doesn't allow table height
to be expressed in percents.

When i have this doctype tag:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
the percents don't work.

I need to make my HTML to be valid 4.01, how can i make a table
populate the whole page? In other words how can i get the same effect
as width="100%" and height="100%"

Thanks,
Alex
Jul 20 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
In post <4c**************************@posting.google.com >
alex said...
It seems like HTML 4.01 Transitional spec. doesn't allow table height
to be expressed in percents.
height is not a valid attribute of <table> in any HTML specification
I need to make my HTML to be valid 4.01, how can i make a table
populate the whole page?
you shouldn't be using tables for layout. having valid html isn't much
use if your document is broken from the start.
In other words how can i get the same effect
as width="100%" and height="100%"


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<title>blah</title>
<style type="text/css">
html,body{margin:0;padding:0;height:100%;}
table{width:100%;height:100%;border:1px solid red;}
</style>
<table><tr><td>blah</td></tr></table>
--
brucie a. blackford. 02/August/2003 07:44:53 am kilo.
http://loser.brucies.com/
Jul 20 '05 #2

P: n/a
"brucie" <br******@loser.brucies.com> wrote in message
news:1w***************@alt-html.org...
In post <4c**************************@posting.google.com >
alex said...
I need to make my HTML to be valid 4.01, how can i make a table
populate the whole page?


you shouldn't be using tables for layout. having valid html isn't much
use if your document is broken from the start.


Out of curiosity (and a lack of finding good info on w3.org), what is the
preferred (standard) method of columnar layout? I never read much about the
table specifications until now, and I can't seem to find where it says using
tables for containing other parts of the layout tree is bad. (I'm sure I'm
not looking quite hard enough.) Do you have a link where I can just start
reading how to layout columns the "proper" way?

I use columns all the time for my layouts' navigation. Until I find out
different, I always use a single-row table to split the page into two or
three columns. I always thought it was kind of clunky, but it got the job
done, and I do feel that it's a bit of a violation of a "good" parse tree to
use a data layout method for page layout.

I looked up COL and COLGROUP, but they are only relative to a table in
context.

Thanks for anyone's advice,
Zac
Jul 20 '05 #3

P: n/a
In post <3f********@news.enetis.net>
Zac Hester said...
you shouldn't be using tables for layout. having valid html isn't much
use if your document is broken from the start.
Out of curiosity (and a lack of finding good info on w3.org), what is the
preferred (standard) method of columnar layout?
CSS
I never read much about the table specifications until now, and I can't seem
to find where it says using tables for containing other parts of the layout
tree is bad.
<quote>
Tables should not be used purely as a means to layout document content
as this may present problems when rendering to non-visual media.
Additionally, when used with graphics, these tables may force users to
scroll horizontally to view a table designed on a system with a larger
display. To minimize these problems, authors should use style sheets
to control layout rather than tables.
</quote> http://www.w3.org/TR/html401/struct/tables.html#h-11.1

also: B.5 Notes on tables
http://www.w3.org/TR/html401/appendi...l#notes-tables
Do you have a link where I can just start reading how to layout columns the
"proper" way?


its very easy to achieve column layouts with CSS

1-3-1 100% available height layout
http://usenet.alt-html.org/1-3-1-css-layout.html

2-1-3-1 content of areas dictates height layout. widths are whatever
you feel like and can be mixed unlike tables:
http://usenet.alt-html.org/2-1-3-1-css-layout.html

but unfortunately IE doesn't support the easiest way to do it so a bit
of playing around or using a different method is needed to support
crappy IE. M$ should be shot.

CSS layout examples:
http://www.glish.com/css/
http://www.csszengarden.com/
http://www.wannabegirl.org/css/
http://tantek.com/CSS/Examples/
http://www.saila.com/usage/layouts/
http://www.bluerobot.com/web/layouts/
http://www.benmeadowcroft.com/webdev/
http://www.xs4all.nl/~apple77/columns/
http://www.meyerweb.com/eric/css/edge/
http://www.htmler.org/tutorials/3/1.html
http://css.nu/articles/floating-boxes.html
http://webhost.bridgew.edu/etribou/layouts/
http://www.roguelibrarian.com/lj/index.html
http://css-discuss.incutio.com/?page=CssLayouts
http://ecoculture.com/styleguide/r/rollovers.html
http://thenoodleincident.com/tutoria...son/index.html
http://www.webreference.com/authorin...yout/advanced/

--
brucie a. blackford. 02/August/2003 09:04:48 am kilo.
http://loser.brucies.com/
Jul 20 '05 #4

P: n/a
"brucie" <br******@loser.brucies.com> wrote in message
news:jb***************@alt-html.org...

<snip>A whole lot of useful info...</snip>

brucie a. blackford. 02/August/2003 09:04:48 am kilo.
http://loser.brucies.com/


Thanks a ton! This is exactly what I was looking for. It's too bad that we
have to tip-toe around this M$ crap all the time. I did like the
closing-bracket bug, though. I have a lot more uses for that little gem.

Thanks again,
Zac
Jul 20 '05 #5

P: n/a
<CITE from="http://www.w3.org/TR/html401/struct/tables.html#h-11.1">

The HTML table model has been designed so that, with author assistance, user
agents may render tables incrementally (i.e., as table rows arrive) rather
than having to wait for all the data before beginning to render.

</CITE>

Excellent! <TABLE style="height:100%"> How?

<CITE from="http://www.w3.org/TR/html401/struct/tables.html#h-11.1">

In order for a user agent to format a table in one pass, authors *MUST* tell
the user agent:

a.. The number of columns in the table. Please consult the section on
calculating the number of columns in a table for details on how to supply
this information.
b.. The widths of these columns. Please consult the section on calculating
the width of columns for details on how to supply this information.
</CITE>

Is this valid HTML by the standard?
<TABLE>
<TR><TD><TD></TR>
<TR><TD><TD><TD><TD></TR>
....
<!--somewhere at the end-->
<TR><TD><TD><TD><TD><TD><TD></TR>
</TABLE>

If yes, could anybody explain me what the hell is this *must* mean?

What renderer should do with the rest?

Is there somewhere LOGICtidy application? Could you give it to authors?

And don't blame on browsers, please. They are trying to render this fuzzy
set.

Andrew.
http://terra-informatica.org

Jul 20 '05 #6

P: n/a
"Andrew Fedoniouk" <an****@terra-informatica.org> wrote:
<CITE from="http://www.w3.org/TR/html401/struct/tables.html#h-11.1">

The HTML table model has been designed so that, with author assistance, user
agents may render tables incrementally (i.e., as table rows arrive) rather
than having to wait for all the data before beginning to render.

</CITE>

Excellent! <TABLE style="height:100%"> How?
Sorry, what's your point? The HTML spec refers to just HTML if you add
CSS on top of that you may end up putting the browser in the position
of having to choose whether to follow the HTML or the CSS...
<CITE from="http://www.w3.org/TR/html401/struct/tables.html#h-11.1">

In order for a user agent to format a table in one pass, authors *MUST* tell
the user agent:

a.. The number of columns in the table. Please consult the section on
calculating the number of columns in a table for details on how to supply
this information.
b.. The widths of these columns. Please consult the section on calculating
the width of columns for details on how to supply this information.
</CITE>

Is this valid HTML by the standard? <TABLE>
<TR><TD><TD></TR>
<TR><TD><TD><TD><TD></TR>
<TR><TD><TD><TD><TD><TD><TD></TR>
</TABLE>
Yes it's valid. But it does not meet the additional criteria that you
quote above.
If yes, could anybody explain me what the hell is this *must* mean?


Look at the <col> element. That's what tells the browser the number of
columns. As you haven't included any <col>s then the browser can not
"format a table in one pass"

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #7

P: n/a
> Look at the <col> element. That's what tells the browser the number of
columns. As you haven't included any <col>s then the browser can not
"format a table in one pass"


<TABLE>
<COL>
<TR><TD><TD></TR>
<TR><TD><TD><TD><TD></TR>
<TR><TD><TD><TD><TD><TD><TD></TR>
</TABLE>

And now it can?

"In order for a user agent to format a table in one pass, authors *MUST*
tell
the user agent...."

I did. So what?
Andrew.
http://terra-informatica.org

Jul 20 '05 #8

P: n/a
"Andrew Fedoniouk" <an****@terra-informatica.org> wrote:
Look at the <col> element. That's what tells the browser the number of
columns. As you haven't included any <col>s then the browser can not
"format a table in one pass"


<TABLE>
<COL>
<TR><TD><TD></TR>
<TR><TD><TD><TD><TD></TR>
<TR><TD><TD><TD><TD><TD><TD></TR>
</TABLE>

And now it can?

"In order for a user agent to format a table in one pass, authors *MUST*
tell
the user agent...."

I did. So what?


So if a browser only displays the first table cell in each row you
only have yourself to blame.

More likely the browser will realise that you have made an error and
will reformat the table, i.e. it will take more than one pass. As you
haven't complied with the requirements given you can't expect anything
else.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #9

P: n/a
Andrew Fedoniouk wrote:
<quote>
Tables should not be used purely as a means to layout document content
as this may present problems when rendering to non-visual media.
To minimize these problems, authors should use style sheets
to control layout rather than tables.


<LI style="margin-left:-100px; position:absolute:top:-10000px" >Lets full
the Lynx. It will think that I am list item. But I am not! Some wise
author (or might be user) applied some weird CSS style to my pure
body.</LI>


The <li> element type is to put items into lists. If you don't follow that
part of the specification, then what makes you think the advice given in
other parts of the specification will still hold true?

HTML and CSS are not designed to obviate the need for human intelligence
when marking up documents. Is it a list? No? The don't use any of the
list element types.
[snip] CSS it just an Eldorado for spammers. They can full any content analyzer.


CSS isn't content.
--
Jim Dabell

Jul 20 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.