RE: [PHP] New to PHP question
| From: | Ashley Sheridan | Date: | Wed, 28 Jan 2009 23:42:47 +0000 |
| Subject: | RE: [PHP] New to PHP question | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-287340@lists.php.net to get a copy of this message | ||
On Wed, 2009-01-28 at 16:05 -0600, Boyd, Todd M. wrote:
> > -----Original Message-----
> > From: Stephen [mailto:stephen-d@rogers.com]
> > Sent: Wednesday, January 28, 2009 1:41 PM
> > To: Paul M Foster
> > Cc: php-general@lists.php.net
> > Subject: Re: [PHP] New to PHP question
> >
> > Paul M Foster wrote:
> > > If you want exact layout (columns
> > > lined up, etc.), the simplest solution is to use HTML tables.
> > >
> > >
> > >
> > The horror.
> >
> > Do not use tables for layout.
> >
> > Use CSS.
> >
> > Especially now that Microsoft, just this week, is sending out IE 8
> > which
> > seems to be fully CCS standards compliant.
>
> Your high horse--get off of it.
>
> Are you not familiar with "div-itis"? If I need to represent data in a
> grid-style layout, I am going to use a <table> every time instead of
> making tons of <div> elements and tying them into the appropriate CSS.
>
> http://www.giveupandusetables.com
>
> Also... as far as I know, XHTML 1.0 Strict and XHTML 1.1 still include
> the <table> tags. I can understand wanting to separate style from
> structure, but I think that tables are more structural than stylish. You
> have to draw the line somewhere.
>
> If you're displaying tabular data, use a table. If you just want stuff
> to be in a grid and the structure has no bearing on the content, then
> it's time to weigh in.
>
> Finally, just because IE8 is (supposed to be) fully CSS standards
> compliant doesn't mean anything for IE7, IE6, IE5, etc.
>
>
> // Todd
>
I hate div'itis as well. Some people seem to think it's a big faux pas
to use table tags now, when that couldn't be more wrong. Use tables for
tabular data, CSS for the rest (with as few exceptions - and there are
always some eh - as you can manage.) I've seen people try to rebuild a
table of data, that you might represent in a spreadsheet, as a
collection of div's. Bad form, as the data has now lost all meaning.
This is the same as replacing all your <h1> tags with <div
class="header1"> or <strong> with <span class="bold">. Silly
idea, slap
on the wrist, don't do it again.
Personally, CSS is my preferred way of working now. I can define a whole
bunch of elements, semantically as possible, and then can redefine the
look as often as I wish afterwards with CSS. Look at the CSS Zen Garden
if you don't believe how useful this is. Rather than going through a
bunch of page to replaces tables, or PHP code to change the output
layout, you can redefine your CSS to alter the look. It's not a black
art, it just needs a little practise. Remember how bad we all were when
we first started using HTML? It's exactly the same thing here!
Ash
www.ashleysheridan.co.uk