homepage Welcome to WebmasterWorld Guest from 54.166.100.8
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderator: open

CSS Forum

    
Columnar output for product list
Can this be done solely with CSS?
roblaw




msg:3251731
 9:09 pm on Feb 13, 2007 (gmt 0)

I am going to be outputting some data from a DB and I have traditionally done so with Tables. I would like to see if it is possible to do solely with CSS to achieve the same result.

I simply need:
Product Name Product Description Product Price

Obviously this is easy in a table:

<table>
<my_Loop>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</my_Loop>
</table>

However, I would like to see if this is possible using CSS alone. Right about now I am doubting it. Everything I am trying is turning up a little odd.

<my_Loop>
<div id="container">
<div id="center">price</div>
<div id="leftRail">name</div>
<div id="rightRail">descr</div>
</div>
</my_Loop>

I am positioning each of the above elements and things are reacting rather funny (not to mention the validation issues). Can anyone point out a decent method to handle this in CSS?

Thanks,

roblaw

 

sgietz




msg:3251754
 9:24 pm on Feb 13, 2007 (gmt 0)

Tables are perfectly fine for displaying data. The grudge that most people have with tables, is that they are being used for layout, which they shouldn't. But you can and should use them for the purpose for which they were created for and that's the display of data. Don't feel bad about it ;-)

jimbeetle




msg:3251756
 9:25 pm on Feb 13, 2007 (gmt 0)

This doesn't answer your question (mainly 'cause I can't), but tables are the proper format for this type of tabulated data. And the table spec includes all the elements needed for accessibility, whereas this would be kind of difficult (impossible?) using CSS.

roblaw




msg:3251957
 2:18 am on Feb 14, 2007 (gmt 0)

I was trying to keep with the completely CSS style of the site and couldn't figure out a method using CSS. Guess I will go ahead with the tried and true.

Thanks for the feedback.

roblaw

Setek




msg:3252154
 7:26 am on Feb 14, 2007 (gmt 0)

I was trying to keep with the completely CSS style of the site and couldn't figure out a method using CSS. Guess I will go ahead with the tried and true.

I think the point everyone is trying to make is that CSS and tables aren't mutually exclusive - you can find lots of ways to prettily style a table using CSS.

When you are structuring tabular data not as a table, taking it out of the semantic structure it should be in, you're doing something tantamount to those that do use tables for non-tabular data. Which is to say, semantically bad.

Let me put it another way - without CSS on a CSS-Presented website, the document falls into neatly-structured content.

How would tabular data in a table look without CSS? Logical, neatly-structured content.

How would tabular data that wasn't in a table look without CSS? Would it still make sense?

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved