Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Why do people hate tables?

  1. #1
    Join Date
    Sep 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Why do people hate tables?

    I've decided to learn CSS.

    No big deal you might say -- but this old man was making magazines by sticking down waxed bits of paper long before the first Tandy TRS80 hit Australia in the '70s.

    I've worked my way through to nested tables, and just got DW CS3.

    Like so many others, I need equal length columns on a 3 col web page.

    I got every template I need right here at DD, and read all the comments about the equal column .js thingy.

    And I have this question: Can I use CSS AND tables? I mean, just set up a nice Fixed-Fluid-Fixed 3 column table and slip it in between a CSS header and a footer. And then use CSS for everything else.

    Wouldn't that solve the problem?

    I'd appreciate anyone with enough patience with my ignorance to let me know

    Thanks in advance

    Old John

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    You can mix it however you want, unless something explicitly conflicts with another element.

    You can use CSS even ON tables.

    CSS stands for cascading style sheet-- and usually really means the formatting therein.

    CSS in it's simplest form is just a different way of writing html attributes--
    background-color: #FFFFFF;
    (rather than bgcolor="#FFFFFF")
    There are, though, more css properties than html attributes, and it can also be more organized.

    So, using that, you can apply it using the style attribute on most tags--
    <span style="css: css;">
    Or in the head section, either embedded or with an external stylesheet, with elements defined (ie, any 'a' tags, or any tag with class="test") by properties.

    These properties then affect the elements.

    You can use CSS to manipulate div regions (not something you can do with html alone) to have the same effects as tables.

    Tables, likewise, could have CSS properties.

    <table> tags and other CSS on the page are certainly not going to have any trouble both existing.


    So... you ask... why not tables?

    1. Using CSS to define divs, though more work at times, can end up with a neater page, and, with enough work, sometimes more control.
    2. Tables can be very slow to render at times.
    3. Tables are meant for tabular data (ie, numbers), rather than chunks of the page.
    4. Different browsers handle tables differently, so making them consistent isn't fun.
    5. Tables are generally overkill. Why write so many elements for a single part of the page, where <div class="content"></div> (with CSS at the top) would do, you need <table border="0"><tr><td></td></tr></table>, plus any actual formatting. Having extra elements is also a pain, specifically arbitrary borders/spacing defined in variors browsers. Tables can sometimes even ignore the main font settings for the page.

    No one hates tables outright. They just are used in a way they weren't designed for sometimes.


    Admittedly, CSS is harder to learn/control than tables, but it ends up nicer.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Sep 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Aah -- too magic!

    It's now completely clear.

    I really appreciate your concise, well constructed post.

    So while I get this old brain around all this new CSS, I'll opt for mix-and-match and then finally wean myself off tables -- I think that'll be best!

    And if there are more people as helpful as you have been around in here, I guess I'll have no shortage of answers if I have a question from time to time?

    (But I don't want to be an annoying old fart)

    Cheers, and thanks again

    John

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    See: http://www.hotdesign.com/seybold/everything.html.

    djr33's hit it on the head, but as that slideshow says, there are some things for which tables are currently much better than CSS -- e.g. equal-height columns. There are various hacks to do it this way (which purists such as myself tend to rather masochistically use), but to be honest, tables are much neater. It should be noted, though, that the cause for this unreasonable difficulty in creating such layouts lies not in deficiencies in CSS but in IE's lack of support for display: table-cell; property, which would allow us to create table-like layouts using pure CSS.
    And if there are more people as helpful as you have been around in here, I guess I'll have no shortage of answers if I have a question from time to time?

    (But I don't want to be an annoying old fart)
    No no, that's what we're here for.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    which purists such as myself tend to rather masochistically use
    And so I end up debating with myself whether to mess with that or just use "ugly" tables
    Tables are cookies.
    Divs are some sort of whole grain healthfood snack, with no salt.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I don't hate tables.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Sep 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I'm most impressed with all of you!

    Thanks you all once again

    Old John

  8. #8
    Join Date
    Oct 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Another Point I might add, you may be aware of this.

    But , if you often read your code and make changes , style sheets get rid of allot of code in your HTML doc. If you chose to use tables for example

    rather then in html tag of table being <table> you can be specific, so if you have more then one table in a website , then using a class name like

    <table id="content"> <-------u just gave your table a name, now in the style sheet you can change any number of things such as font, size, color, back ground etc even add a back ground image. And guess what becuse it is a class name it wont effect the other tables in your site .

    This Gives you full control without CODe mess in yoiur html.

  9. #9
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    One thing that is often overlooked about the much maligned table element is that if you lay it out in a consistent and logical manner as far as the width of the first row's cells and all of the table's contents go, and it isn't going to have its content's width changed markedly via scripting, you can use the:

    Code:
    selector_for_this_table {
    table-layout:fixed;
    }
    style for it in your stylesheet. For an otherwise complex table, this greatly increases the speed at which it will load.

    Quote Originally Posted by Tawni View Post
    <table id="content"> <-------u just gave your table a name, now in the style sheet you can change any number of things such as font, size, color, back ground etc even add a back ground image. And guess what becuse it is a class name it wont effect the other tables in your site .

    This Gives you full control without CODe mess in yoiur html.
    The concept is sound. However, you gave the table an id not a name (names won't help you style a table, or anything else using a stylesheet). And, it isn't a class name either. You would do that like so:

    Code:
    <table class="content">
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  10. #10
    Join Date
    Oct 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1
    The concept is sound. However, you gave the table an id not a name (names won't help you style a table, or anything else using a stylesheet). And, it isn't a class name either. You would do that like so:

    Code:
    <table class="content">
    Thanks , I aprec the help pointing that out, as I am sure you know I was trying to help, but I guess I'm too new to this , I probably should have researched more before posting to save confusion, rather then go off memory.

    I was Close LOL

    Thanks again.
    Last edited by Twey; 10-08-2007 at 04:12 PM. Reason: Amended quotation credit -- sorry John!

Bookmarks

Posting Permissions

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