Re: php.net layout with CSS-P

From: Date: Wed, 23 Jul 2003 16:04:36 +0000
Subject: Re: php.net layout with CSS-P
References: 1 2  Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-19499@lists.php.net to get a copy of this message
Gabor Hojtsy wrote:
Is there a way to have the middle part where all the content is with divs instead of tables? Are tables non-xhtml compliant or the reason for using div/css is just the size of the page?
The reason to use <div>s instead of <table>s is the size of the page, the cleanness of HTML code, the easier generation of it from PHP, and the possibility to apply multiple style sheets to achive different layout without downloading a new HTML page (eg. print layout, layout without extensive navigation header, etc.). Also by using divs instead of tables, the page displays faster (additionaly to the faster download), as the browsers does not need to wait for the full table content to download. Having the whole content in a table (as we have currently), means that the browser need to download the whole table contents before displaying anything. The only disadvantage to consider is that we need to drop support for Netscape 4, but I think this is well worth the innovation, as we can support 99% of our user base much better, who use some browser that actually works... Goba
Tables where never meant to be used for page layouts, when we say remove tables is meant that we should we stop using it for this wrongful purpose, not entirely. Using tables for tabular data as it is intended is just fine. Netscape 4 *actually* degrades really well, if you know what you're doing, by using *semantic* markup. For example: <div class="main_text"> This is just our main body text </div> should be banned in place of this more correct markup: <p class="main_text"> This is just out main body text </p> Simple reason is that <div> is a generic block element, it has no style or semantic value by default, whereas <p> does, and even if NS4 doesn't understand the CSS, it will still understand the <p>.
I have tried to validate the frontpage as XHTML 1.0 Strict, as I have seen some "strange" invalid parts, like that input fields shuold be in some container, which I was absolutely anaware of. Though it seems there will be little to add to the pages to make them XHTML 1.0 Strict compliant, if someone is ready to do so.
The solution is that <form> may *not* be nested inside certain tags, but its contents *must* be. The following is valid XHTML 1.0 Strict. <div id="search_form"> <form ...>
    <p>
      <input ... />
      <input ... />
    </p>
</form> </div> - Davey

« previous php.mirrors (#19499) next »