Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > div or table?

Reply
Thread Tools

div or table?

 
 
Jim S.
Guest
Posts: n/a
 
      02-12-2006
am designing my page layout and I am confused which to choose, should I
choose Tables or DIV for layout.
any suggestions?

Jim


 
Reply With Quote
 
 
 
 
Barbara de Zoete
Guest
Posts: n/a
 
      02-12-2006
On Sun, 12 Feb 2006 21:00:52 +0100, Jim S. <(E-Mail Removed)> wrote:

> am designing my page layout and I am confused which to choose, should I
> choose Tables or DIV for layout.
> any suggestions?


Neither. Use the proper elements for the content you want to serve out to
your visitor. So a paragraph is a paragraph. A header is a header, a list
is a list, a table is a table, an abbreviation is an abbreviation. If
something needs to be emphasized, you give it emphasis. There are so many
elements around you could use (see
<URL:http://www.w3.org/TR/html401/index/elements.html>, that is hard to
imagine you think of content that can't be marked up with one of those.
However, if there is content for which there is realy no specific element
available, _than_ you use a div for a block level element and a span for
inline content.

Oh, and to answer your question: use CSS2.1 for layout
<URL:http://www.w3.org/TR/CSS2/>.


--
______PretLetters:
| weblog | http://www.pretletters.net/weblog/weblog.html |
| webontwerp | http://www.pretletters.net/html/webontwerp.html |
|zweefvliegen | http://www.pretletters.net/html/vliegen.html |
 
Reply With Quote
 
 
 
 
Jose
Guest
Posts: n/a
 
      02-12-2006
> Use the proper elements for the content you want to serve out to your visitor. So a paragraph is a paragraph. A header is a header, a list is a list, a table is a table, an abbreviation is an abbreviation.

As a philosophy, I agree. But it doesn't always quite fit. Computers
are like that. For example, I have a heading ("Seven pictures of
Atlas") and the material for which this is a heading are in fact, seven
..jpgs. But I want to have, under the heading, "compare these to Baal".
Why under? Because the subheading (I'll call it that for now) is
subservient to and relates to the heading (or rather, to the material as
a whole, which is embodied in the heading). The pictures are not
subservient to the subheading, they are subservient to the heading. So,
what I'm calling a subheading is not really a subheading, it's a
something-else (for which there probably isn't an appropriate tag).
Human readers would get it perfectly if the putative subheading were in
smaller type, below the heading with no fuss.

I can do that easily if I skip the heading stuff, and just specify both
heading and subheading as "body text", centered, with "bigger" and "not
so much bigger" as type sizes. This tells humans what it is (by virtue
of the style), but doesn't tell the browser what it is.

Or, I can apply some styling to the header. This is closer to ideal,
since at least we can call a heading a heading, but we are then =still=
using style to convey meaning (which is supposed to be what CSS is
trying to outlaw).

It just isn't always the case that you can tell the browser what a thing
is, because the browser just doesn't have a big enough vocabulary.
Computers have square holes, and pegs come in all sorts of shapes,
sizes, and textures.

Jose
--
Money: what you need when you run out of brains.
for Email, make the obvious change in the address.
 
Reply With Quote
 
Barbara de Zoete
Guest
Posts: n/a
 
      02-12-2006
On Sun, 12 Feb 2006 23:04:51 +0100, Jose <(E-Mail Removed)> wrote:

>> Use the proper elements for the content you want to serve out to your
>> visitor. So a paragraph is a paragraph. A header is a header, a list
>> is a list, a table is a table, an abbreviation is an abbreviation.

>
> As a philosophy, I agree. But it doesn't always quite fit.


That's why there is a div and a span as elements. Still doesn't say
anything on how they are supposed to look.

> For example, I have a heading ("Seven pictures of Atlas") and the
> material for which this is a heading are in fact, seven .jpgs. But I
> want to have, under the heading, "compare these to Baal".


Something like (ugly variant):

<h1>Seven pictures of Atlas <span>compare these to Baal</span></h1>

<ol>
<li>pic1</li>
<li>pic2</li>
<li>pic3</li>
<li>pic4</li>
<li>pic5</li>
<li>pic6</li>
<li>pic7</li>
</ol>

And then:

h1 {
font-size:160%;
font-weight:bold; }

h1 span {
display:block;
clear:both;
font-size:135%; }

Or maybe (clean variant):
Just put <div class="remark">compare these to Baal</div> underneath the
heading, and create some appropriate styles for that div.remark. Since the
content really seems to be nothing else, a div is perfectly appropriate
for it.


> Why under? Because the subheading (I'll call it that for now) is
> subservient to and relates to the heading (or rather, to the material as
> a whole, which is embodied in the heading). The pictures are not
> subservient to the subheading, they are subservient to the heading. So,
> what I'm calling a subheading is not really a subheading, it's a
> something-else (for which there probably isn't an appropriate tag).


Hence the div or the span. I know and understand that. But that still has
nothing to do with your original question: use tables or divs for layout.
You're confusing markup and looks.

> I can do that easily if I skip the heading stuff, and just specify both
> heading and subheading as "body text", centered, with "bigger" and "not
> so much bigger" as type sizes. This tells humans what it is (by virtue
> of the style), but doesn't tell the browser what it is.


I know that certain markup has a certain look in graphical browsers (and
no where else). That is why it is possible to confuse the two. Try your
pages in Lynx or Opera (using the [Emulate Text Browser]) before anywhere
else. There you will see that you shouldn't confuse looks and semantics of
markup. Markup is to 'tell' a browser what something is. You style the
elements with CSS to tell the browser how things should look.

> Or, I can apply some styling to the header. This is closer to ideal,
> since at least we can call a heading a heading, but we are then =still=
> using style to convey meaning (which is supposed to be what CSS is
> trying to outlaw).


No. You are styling for the looks, and yes, that looks mean something to
the human mind. At least for those who get to see those looks. For all
others (text browser, braille browser, aural browser, screen reader) you
give meaning through correct markup, which in it self will get
interpreted. I don't have screen readers running, but I can imagine that a
heading gets read different from a div or a paragraph.

> It just isn't always the case that you can tell the browser what a thing
> is, because the browser just doesn't have a big enough vocabulary.


That is true. But there really is so much.


--
______PretLetters:
| weblog | http://www.pretletters.net/weblog/weblog.html |
| webontwerp | http://www.pretletters.net/html/webontwerp.html |
|zweefvliegen | http://www.pretletters.net/html/vliegen.html |
 
Reply With Quote
 
Tommy
Guest
Posts: n/a
 
      02-13-2006
Barbara de Zoete wrote:

> Oh, and to answer your question: use CSS2.1 for layout
> <URL:http://www.w3.org/TR/CSS2/>.


From that page...

W3C Recommendation 12-May-1998

It's not even worth to look at recomendation from this year!

;-O

 
Reply With Quote
 
David Dorward
Guest
Posts: n/a
 
      02-13-2006
Tommy wrote:

> W3C Recommendation 12-May-1998


.... which was when CSS 2 was published

> It's not even worth to look at recomendation from this year!


What recomendation from this year? There hasn't been a new version of the
language published in the last month and a half (and even if there was,
browser support would probably be too weak to make it worth bothering
about).

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
<div ... /> and <div ...></div> K Viltersten ASP .Net 4 03-31-2009 07:33 PM
<div id="help" runat="server"></div> Jim in Arizona ASP .Net 3 11-17-2005 04:15 PM
NS/FF don't change div offsetWidth when div innerHTML is added toand div becomes wider mscir Javascript 3 06-26-2005 04:04 PM
Q: Div A inside Div B is larger than Div B Dwayne Madsen Javascript 1 06-01-2005 03:02 PM
<label><div></div></label> allowed? Josef K. ASP .Net 3 05-22-2005 02:13 PM



Advertisments