18 replies [Last post]
martha
martha's picture
Offline
Enthusiast
Athens, Greece
Last seen: 5 years 14 weeks ago
Athens, Greece
Timezone: GMT+3
Joined: 2005-05-14
Posts: 66
Points: 0

Hi!
Currently, I redesign a site .

The new layout I m working on is using css, BUT I need to display data from a database.

Since till now I ve worked with css only in static pages, I m wondering what should I do?

Should I use tables or is there an other way?

Thanks for reading my post Smile

Chris..S
Chris..S's picture
Offline
Moderator
Last seen: 9 years 10 weeks ago
Timezone: GMT+1
Joined: 2005-02-22
Posts: 6078
Points: 173

Use tables or not?

There is another way.

If its tabular data, use tables - thats what they are there for.

If its not tabular data work out the markup that is required for each item of data and generate the markup along with the data. These forums are database driven - and there is not a table in sight.

gleddy
gleddy's picture
Offline
Leader
sydney, australia
Last seen: 13 years 30 weeks ago
sydney, australia
Timezone: GMT+10
Joined: 2004-09-21
Posts: 596
Points: 0

Use tables or not?

also, the way we do this is that you create the templates with the appropriate markup and then generate only the dynamic content within this template code.

So it's like an include. Most of your dynamic content would just be text I assume.

martha
martha's picture
Offline
Enthusiast
Athens, Greece
Last seen: 5 years 14 weeks ago
Athens, Greece
Timezone: GMT+3
Joined: 2005-05-14
Posts: 66
Points: 0

Use tables or not?

Yes, it is text and images...I m not going to use tables Smile

briski
briski's picture
Offline
Elder
London
Last seen: 9 years 25 weeks ago
London
Timezone: GMT+1
Joined: 2004-02-16
Posts: 1066
Points: 0

Use tables or not?

Bah it's all greek to me... I'll get my coat...

But before I leave with my head hung in shame i'll say this - Just because data is comming from a database does not mean it's tabular data that should be displayed in tables.

Oh no don't fall into that trap! There have been some hilarious defenses of table based layouts on the argument that if it's from a database it's tabluar data by definition (I can't find the link to the best one alas, which is a shame cause it makes amusing reading). Obviously that is a nonsensical argument and should be ignored Laughing out loud

As Chris S points out this site is database driven but it's not tabluar data hence no tables.

So in short I think you made the right choice not to use tables.

gleddy
gleddy's picture
Offline
Leader
sydney, australia
Last seen: 13 years 30 weeks ago
sydney, australia
Timezone: GMT+10
Joined: 2004-09-21
Posts: 596
Points: 0

Use tables or not?

exactly... if you render a page then look at the source code is it considered tabular data?

that's the way I would figure it out... always doing static html mockups and then figure out how implement dynamically inserting the info afterwards. Should work all the time, correct?

Chris..S
Chris..S's picture
Offline
Moderator
Last seen: 9 years 10 weeks ago
Timezone: GMT+1
Joined: 2005-02-22
Posts: 6078
Points: 173

Use tables or not?

gleddy wrote:
...
that's the way I would figure it out... always doing static html mockups and then figure out how implement dynamically inserting the info afterwards. Should work all the time, correct?

Spot on. static html mockups, so you only need to work one thing out at at time.
- first the html required.
- second the styles, adding in any extra html if necessary
- last, scripted generation of those parts which need it.

You will be struggling up hill if your script isn't generating the correct html and you are still trying to sort out what html & styles are required to get the output you are after.

drhowarddrfine
Offline
Leader
Last seen: 12 years 3 days ago
Timezone: GMT-6
Joined: 2005-05-21
Posts: 764
Points: 0

Use tables or not?

Quote:
martha
Newbie
Newbie

Joined: 14 May 2005
Posts: 7
Location: Athens, Greece

Quote:
Bah it's all greek to me...

Then you should have no problem with this. Wink

gleddy, you have got to change your avatar. That is just so ugly.

IE7 is 10 years behind the standards or wrong.
But it works in IE!
IE is a cancer on the web -- Paul Thurott

wolfcry911
wolfcry911's picture
Offline
Guru
MA, USA
Last seen: 7 years 39 weeks ago
MA, USA
Timezone: GMT-5
Joined: 2004-09-01
Posts: 3224
Points: 237

Use tables or not?

drhowarddrfine wrote:

gleddy, you have got to change your avatar. That is just so ugly.

LOL Laughing out loud
I'm sorry gleddy, but I have to agree Cool

briski
briski's picture
Offline
Elder
London
Last seen: 9 years 25 weeks ago
London
Timezone: GMT+1
Joined: 2004-02-16
Posts: 1066
Points: 0

Use tables or not?

drhowarddrfine wrote:
gleddy, you have got to change your avatar. That is just so ugly.

Actually I meant to ask, what the hell is that in you avatar, a monkey drinking beer or something? :?

larmyia
Offline
Elder
London
Last seen: 13 years 11 weeks ago
London
Timezone: GMT+1
Joined: 2005-01-25
Posts: 1060
Points: 0

Use tables or not?

I didn't like to say anything, but it is minging gleddy! painful to look at!

ps Briski, sounds like your greek classes may pay off on this post!

martha
martha's picture
Offline
Enthusiast
Athens, Greece
Last seen: 5 years 14 weeks ago
Athens, Greece
Timezone: GMT+3
Joined: 2005-05-14
Posts: 66
Points: 0

Use tables or not?

briski wrote:

Actually I meant to ask, what the *beep* is that in you avatar, a monkey drinking beer or something? :?

I think it is a monkey holding a bottle of perfume Laughing out loud

Tabular data are considered to be data which deal with numbers? :roll:

Anyway, thanks a lot guys, you ve been very helpful!!!

larmyia
Offline
Elder
London
Last seen: 13 years 11 weeks ago
London
Timezone: GMT+1
Joined: 2005-01-25
Posts: 1060
Points: 0

Use tables or not?

martha wrote:
I think it is a monkey holding a bottle of perfume Laughing out loud

erm, think it's beer...

wolfcry911
wolfcry911's picture
Offline
Guru
MA, USA
Last seen: 7 years 39 weeks ago
MA, USA
Timezone: GMT-5
Joined: 2004-09-01
Posts: 3224
Points: 237

Use tables or not?

Tabular data could deal with numbers, but it isn't a requirement. Any items that show a relationship.

roytheboy
roytheboy's picture
Offline
Guru
North Wales, UK
Last seen: 8 years 19 weeks ago
North Wales, UK
Timezone: GMT+1
Joined: 2004-09-18
Posts: 2233
Points: 41

Use tables or not?

martha wrote:
Tabular data are considered to be data which deal with numbers?

If you're presenting data in a similar format to a classic spreadsheet (i.e. a table of data with rows and columns that all relate to each other) then you would use a <table> to display it. For example, the data might be about your cats, where each row represents one cat and the columns are labelled: name, sex, colour, weight, birth date. If the information needs to presented in a tabular fashion for statistical analysis then a <table> would be the logical best choice. But if you are presenting the information more as a photo album with a bit of supporting information, it might still be shown in rows of similar blocks of information but it would not necessarily be tabular, so you would use <div>s. This forum page comprises of repeated blocks of information but it is not tabular and it has no column headers, whereas the colourful data on this page > http://hsivonen.iki.fi/doctype/ is most definitely tabular. Is that any clearer?

Life's a b*tch and then you die!

martha
martha's picture
Offline
Enthusiast
Athens, Greece
Last seen: 5 years 14 weeks ago
Athens, Greece
Timezone: GMT+3
Joined: 2005-05-14
Posts: 66
Points: 0

Use tables or not?

Crystal clear, thanks!

gleddy
gleddy's picture
Offline
Leader
sydney, australia
Last seen: 13 years 30 weeks ago
sydney, australia
Timezone: GMT+10
Joined: 2004-09-21
Posts: 596
Points: 0

Use tables or not?

uh oh... I smell mutiny Shock might have to wait for a special occassion to change it!

*it's a person-monkey beast drinking a Carlton Cold! (for all you Aussies).

briski
briski's picture
Offline
Elder
London
Last seen: 9 years 25 weeks ago
London
Timezone: GMT+1
Joined: 2004-02-16
Posts: 1066
Points: 0

Use tables or not?

gleddy wrote:
it's a person-monkey beast

drhowarddrfine wrote:
That is just so ugly.

Hmm I think statement 1 is all the evidence we need to see that statement 2 is probably correct, person-monkey beast indeed, that's an idea of nightmares! Shock

larmyia
Offline
Elder
London
Last seen: 13 years 11 weeks ago
London
Timezone: GMT+1
Joined: 2005-01-25
Posts: 1060
Points: 0

Use tables or not?

very Dr Moroe!