isp

XHTML issues
Menu

Thu Jan 08 2009

Web-Mastery Webmaster Forum

Thu Jan 08 2009

Home

XHTML issues


did you move all of the css to an external file? if so [code:1:057ec188a7] div.table {height:100px; width:200px} [/code:1:057ec188a7] something like that should work.


height never was a valid attribute in html never mind xhtml


This in external css .class { height: 300px; } this for table. <table class="class"> also i think its a valid attribute in TR & TD but not table.


nope i'm almost certain it wasn't valid for td,tr either, but will double check


That's a good exercise to make your site xhtml compatible. Mine is too (mostly). This site helps me a lot http://www.w3schools.com/tags/tag_table.asp It will tells you what tags / attributes are no longer in use.


If you want to find all the latest info and dont mind trawling through loads of links http://www.w3.org is the official site for web standards. w3schools is good for beginners though.


height is deprecated for td http://www.w3.org/TR/html401/struct/tables.html#edef-TD and isn't even listed (deprecated or otherwise) for table http://www.w3.org/TR/html401/struct/tables.html#edef-TABLE margins etc are handled by css now, for example to set margins to zero you can use [code:1:5e2976b877]body { padding: 0; margin: -10px 0 0 -10px; /*/*/margin: 0 0 0 0; /* */ }[/code:1:5e2976b877]


This is from http://www.experts-exchange.com/Web/Web_Languages/HTML/Q_21057287.html Assisted Answer from seanpowell Date: 07/14/2004 06:34AM PDT Grade: A Assisted Answer As far as xhtml goes, the transitional DTD does not allow height on the table tag, but does allow it on the tr and td tags. The strict DTD removes the height attribute from all three. As far as validation goes, height can be specified on the table, tr and td tag - but only using CSS: #mytable { height:600px; } instead of <table id="mytable" height="600"> In either transitional or strict, most browsers will respect the height specified by CSS and render accordingly. Interestingly enough, Opera DOES NOT respect the height specified on the <tr> tag, whether by CSS or inline. The problems arise when the content of the table, row or cell come into conflict with the user-specified heights. The rendering is unpredictable at best, and different browsers are left to their own accord (algorithm) to decide what to do about it. So "ideally" the content should determine the height of the table, and not the other way around. >>It will not hold the specified height unless you also set the height of the rows using CSS and add this to the table styles: table-layout:fixed. Actually that's not quite right. The fixed table algorithm only applies to content "width", not height...


if height isn't valid, what to use?


[quote:7b3695f53a] So "ideally" the content should determine the height of the table, and not the other way around.[/quote:7b3695f53a] table are designed to shrink-wrap around their contents if you need a container of a certain height then use a div and define it's height in a css rule


Why not just use all divs instead of tables?

Most Popular Stories
Broadband ISP