...

View Full Version : CSS recommeneded for database site?



CalypsoClub
08-11-2003, 09:06 PM
Hi,

I'm in the developing process for a database driven site. One of it's main purposes will be to show lists with at least 5 columns.

Those lists will be at least 30, maximum 50 rows long.

Is it better to use tables for this or a CSS layout?

A table would be no problem, but will CSS really do the same job at an equal effort?

My problem with CSS is this: Each table row would need to have an own style class, even each cell would need one. Am I right with this?

Thanks for any help!

Cheers

Vladdy
08-11-2003, 10:06 PM
30+ rows by 5+ columns sounds exacltly like the type of data the tables are meant for :thumbsup:
However I would not go with giving every cell it's own class. What you need to look into is correct assignment of row and column groups.

giz
08-11-2003, 10:35 PM
Is your data actually tabular data?

It sounds like it is, so a table is still the best way to organise and display it.

You can still style each bit using CSS, and an external stylesheet would be a very good idea.

The table cells would only contain the table data (i.e. viewable content) not any presentational (font, b, i, u, etc) tags.
Search engines like that sort of layout too.

CalypsoClub
08-11-2003, 10:49 PM
I planned to do so, but I was wondering if a pure CSS design with div tags could be working since this is kinda state-of-the-art now... ;)

I think I will go with tables and use CSS just for formatting like always.

@Vladdy: What do you mean with column groups?

Thanks!

brothercake
08-11-2003, 10:53 PM
Originally posted by CalypsoClub
I planned to do so, but I was wondering if a pure CSS design with div tags could be working since this is kinda state-of-the-art now... ;)
You're slightly missing the point - you shouldn't use pure CSS for tabular data, for exactly the same reason as not using tables for layout. Use each thing for its correct purpose.

CalypsoClub
08-12-2003, 12:13 AM
So you mean I should do the layout with CSS and use still tables for the data? Can I combine these two techniques without problems?

I guess I will try it this way. I played a little bit with CSS earlier this day and I found it quite nice. You can easily build layouts consisting of blocks with borders, margins, padding, bg images and stuff with writing just one line of HTML. The rest is pure CSS.

But I also found that different browsers interpret CSS differently. Why do we have standqrds if every browser interprets them another way?:( This clearly makes using CSS much harder as it could and should be.

Mhtml
08-13-2003, 07:11 AM
It seems to me that you are getting your terms mixed around a little bit and are under the wrong impression of a "css" design.

Firstly I believe you are refering to a modern xhtml style which uses no tables for the layout of the website or arrangement of content other than data like what vladdy said earlier, the ammount of data that you seem to be propsing you will be outputing is perfect for the table structure which is specifically intended for what you need.

Div, p, span etc are mainly used for the positioning of layout data which includes images, links, menus, content etc.

So by saying a combination you are meaning that you should use a mixture of the pre stated elements and then tables for the output of row/column specific data from your database, just like a forum would display a list of thread but could theoretically easily display post data like you are currently reading in one of those elements.

giz
08-13-2003, 09:32 PM
Use a normal HTML-coded <table><tr><td> table for the data and put the content in table cells.

Use an external CSS stylesheet to just define the font, colour, size, etc of the elements.



No need to try to build a table-like display by using div and span and CSS positioning. That really is not the way to do it.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum