Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Mar 2003
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CSS recommeneded for database site?

    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

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    30+ rows by 5+ columns sounds exacltly like the type of data the tables are meant for
    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.
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

  • #3
    giz
    giz is offline
    Regular Coder
    Join Date
    Apr 2003
    Location
    UK
    Posts
    226
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #4
    New Coder
    Join Date
    Mar 2003
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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!

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

  • #6
    New Coder
    Join Date
    Mar 2003
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #7
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post
    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.
    Omnis mico antequam dominus Spookster!

  • #8
    giz
    giz is offline
    Regular Coder
    Join Date
    Apr 2003
    Location
    UK
    Posts
    226
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •