Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Why CSS tables?

Reply
Thread Tools

Why CSS tables?

 
 
dmcconkey@yahoo.com
Guest
Posts: n/a
 
      05-28-2005
Hi folks,

In reading the thread "Column width in a CSS table", I realized there
was much confusion over CSS tables--rather the CSS display:table family
of CSS properties. I then wondered if I might have it all wrong...

I avoid display:table thanks to the plague that is Internet Explorer.
Though, generally, I avoid tables anyway. No problem. Tables (HTML
tables this time) are for conveying tabular data. Not layout.

CSS handles layout fairly well, assuming you're not emulating some
graphic designer's idea of a webpage. When I want to control float and
position, I use CSS. When I generate a year-end revenue report, I use
HTML tables.

Is this now antiquated? I've always thought that tables are still okay
for organizing tabular data. After all, that's using HTML for
structure--as it should be.

Why then do CSS tables exist? Why would I want to emulate HTML table
tags using CSS display properties?

Have I missed the boat entirely? Am I now as confused as I was in 1998?

Thanks,
-Dan

 
Reply With Quote
 
 
 
 
Barbara de Zoete
Guest
Posts: n/a
 
      05-28-2005
On 27 May 2005 20:08:13 -0700, <(E-Mail Removed)> wrote:

> In reading the thread "Column width in a CSS table", I realized there
> was much confusion over CSS tables--rather the CSS display:table family
> of CSS properties. I then wondered if I might have it all wrong...


[ tables for tabular data; no tabular data no table. No? ]

> Why then do CSS tables exist? Why would I want to emulate HTML table
> tags using CSS display properties?
>
> Have I missed the boat entirely? Am I now as confused as I was in 1998?
>


I wouldn't know about your confusion, but in
<http://www.w3.org/TR/CSS2/tables.html> it says:

<quote>
The CSS model does not require that the document language
include elements that correspond to each of these components.
For document languages (such as XML applications) that do not
have pre-defined table elements, authors must map document
language elements to table elements; this is done with the
'display' property.
</quote>

and

<quote>
17.2.1 Anonymous table objects
Document languages other than HTML may not contain all the
elements in the CSS2 table model. In these cases, the "missing"
elements must be assumed in order for the table model to work.
</quote>

So, CSS tables are especially useful for use with document languages other than
HTML, like XML, that do _not_ have elements necessary for creating data tables.

--
,-- --<--@ -- PretLetters: 'woest wyf', met vele interesses: ----------.
| weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
| webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
|zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
`-------------------------------------------------- --<--@ ------------'

 
Reply With Quote
 
 
 
 
Toby Inkster
Guest
Posts: n/a
 
      05-28-2005
Barbara de Zoete wrote:

> So, CSS tables are especially useful for use with document languages
> other than HTML, like XML, that do _not_ have elements necessary for
> creating data tables.


And also for creating a tabular look where the data might not actually
be tabular.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

 
Reply With Quote
 
Travis Newbury
Guest
Posts: n/a
 
      05-28-2005
Barbara de Zoete wrote:
> [ tables for tabular data; no tabular data no table. No? ]

<snip>

Man, you made it all the way through their post and did not plonk them...
Is everyone in hell cold now?


--
-=tn=-
 
Reply With Quote
 
dmcconkey@yahoo.com
Guest
Posts: n/a
 
      05-28-2005
Got it. My confusion lay in my narrow perspective of markup languages.
I have little experience with XML, WML, SGML, etc. To me, CSS tables
seemed useless in HTML, and, in fact, they nearly are.

When I broaden my horizons (more likely, when a client pushes me into
designing for Blackberries), I'll give them another look.

Thank you, Barbara.

 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      05-28-2005
> From: http://www.velocityreviews.com/forums/(E-Mail Removed)

> To me, CSS tables seemed useless in HTML, and, in fact, they nearly are.


er... um... hang on a sec pal...

dorayme

 
Reply With Quote
 
dmcconkey@yahoo.com
Guest
Posts: n/a
 
      05-29-2005
I suppose that's what I was asking to begin with. What's a practical
example of CSS tables in HTML? Examples given above were 1) for markup
languages lacking tabular elements, or 2) to emulate a tabular look for
non-tabular data.

The first doesn't apply to HTML. Based on my limited understanding, the
second seems better met with CSS position and float. I'll gladly
retract that last statement if I misunderstood what was meant by that.
(I'm not really sure when I'd want to make something look tabular.)

I'm reading through the CSS2 spec right now, but if anyone can help
fill in my lack of understanding, I'd truly appreciate it.

Thanks,
-Dan

 
Reply With Quote
 
David Dorward
Guest
Posts: n/a
 
      05-29-2005
(E-Mail Removed) wrote:

> The first doesn't apply to HTML. Based on my limited understanding, the
> second seems better met with CSS position and float. I'll gladly
> retract that last statement if I misunderstood what was meant by that.
> (I'm not really sure when I'd want to make something look tabular.)


How many posts does this group get from people looking for 2/3 column
layouts where the backgrounds of the columns are all the same length and
any column can be the longest?

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
 
Reply With Quote
 
David Dorward
Guest
Posts: n/a
 
      05-29-2005
(E-Mail Removed) wrote:

> I suppose that's what I was asking to begin with. What's a practical
> example of CSS tables in HTML? Examples given above were 1) for markup
> languages lacking tabular elements, or 2) to emulate a tabular look for
> non-tabular data.


Oh, and I've just remembered a third reason.

If the layout of tables is defined with CSS, then you can style a data table
so it doesn't look like a table. Thus you might have a table such as:

<table>
<tr> <td> <img> </td> <td> caption </td> </tr>
<tr> <td> <img> </td> <td> caption </td> </tr>
<tr> <td> <img> </td> <td> caption </td> </tr>
</table>

And then style it:

tr {
display: inline-block;
border: solid black 1px;
padding: 1ex;
margin: 1ex;
}

td {
display: block;
}

To have a number of images, each with a caption below, arranged side by side
and flowing onto new lines as needed.


--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
 
Reply With Quote
 
Luigi Donatello Asero
Guest
Posts: n/a
 
      05-29-2005

"David Dorward" <(E-Mail Removed)> skrev i meddelandet
news:d7b543$na5$4$(E-Mail Removed)...
> (E-Mail Removed) wrote:
>
> > I suppose that's what I was asking to begin with. What's a practical
> > example of CSS tables in HTML? Examples given above were 1) for markup
> > languages lacking tabular elements, or 2) to emulate a tabular look for
> > non-tabular data.

>
> Oh, and I've just remembered a third reason.
>
> If the layout of tables is defined with CSS, then you can style a data

table
> so it doesn't look like a table. Thus you might have a table such as:
>
> <table>
> <tr> <td> <img> </td> <td> caption </td> </tr>
> <tr> <td> <img> </td> <td> caption </td> </tr>
> <tr> <td> <img> </td> <td> caption </td> </tr>
> </table>
>
> And then style it:
>
> tr {
> display: inline-block;
> border: solid black 1px;
> padding: 1ex;
> margin: 1ex;
> }
>
> td {
> display: block;
> }
>
> To have a number of images, each with a caption below, arranged side by

side
> and flowing onto new lines as needed.




That is the same as to use tables for the layout instead of using them only
for tabular data, isnīt it? Is that allowed?
What about mixing a table with an unordered list as I tested at
https://www.scaiecat-spa-gigi.com ?

--
Luigi ( un italiano che vive in Svezia)
https://www.scaiecat-spa-gigi.com/






https://www.scaiecat-spa-gigi.com/



 
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
PHP + JS + CSS: why ajax doesn't display using CSS on main doc? SeanInSeattle Javascript 5 12-13-2007 12:50 PM
why why why why why Mr. SweatyFinger ASP .Net 4 12-21-2006 01:15 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
Cisco 2611 and Cisco 1721 : Why , why , why ????? sam@nospam.org Cisco 10 05-01-2005 08:49 AM
Why Why Why You HAVE NO IDEA MCSE 31 04-24-2004 06:40 PM



Advertisments