Forum Moderators: mack

Message Too Old, No Replies

tables, should I use them or not

are tables bad?

         

scockerham

12:54 am on Jun 23, 2003 (gmt 0)

10+ Year Member



I would like to know if table use should try to be avoided?

Stephen

ggrot

1:08 am on Jun 23, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Nothing wrong with tables. Some people are trying to go all out with the whole CSS2 thing, but until IE's market share declines or they update their browser, tables are the best bet.

MWpro

2:47 am on Jun 23, 2003 (gmt 0)

10+ Year Member



If the layout you are trying to achieve isn't too complex, then I would definately consider going with CSS. Btw ggrot, I have never had a problems with my CSS pages with IE.

I wrote this trying to convince a friend to switch:
"CSS gives you the ability to cut down all that nasty code, cut down the page size, separate style from content, make the page load faster for visitors, avoid tag redundancy throughtout your page, have standards compliance, make it easier for spiders to crawl your page, put content at the top of the page to help with spiders/search engine crawling, let visitors have printer friendly pages without having to make duplicate pages, use external stylesheets to style elements on all pages, create fluid layouts, create redesigns easily, let you have control over all properties of any element on the page, much better border control, and I can probably keep going for a few more lines but I think the point is made."

He did, and is happy I convinced him :)

But if you still don't want to make the switch to a complete CSS layout, at least use CSS to get the table tags down as much as possible. If you need to use tables, just use them for the structure or "skeleton" of the site.

scockerham

3:48 am on Jun 23, 2003 (gmt 0)

10+ Year Member



thanks guys...
I will give you a little history on me. I cut my teeth on Commodore64. I got away from any computer stuff for a while in the 80s while went to Basic training and tech school for the AF. I got back into it around 93 and started catching up on everything. In 97 I opened a computer business selling custom built machines. I soon found out the market was falling out of that quickly. I shifted gears into the service side of things took a partner that had all the MSCE certs and we started network admin and design. I myself have been administering Win200 servers, with exchange, citrix, Sybase, etc. I guess I have been a hardware network guru. I also, for the purpose of learning and filling a need for one of my clients started hosting websites. I have 2 DNS servers, 2 IIS servers, and 1 Apache server on W2000 (just started this last week) running. I have been a Frontpage Junkie and do not like it. I build pages using the worst possible methods. They turn out ok, but the code is bad. I am just now trying to turn that around and learn HTML instead of just playing with what FP or someone else produces. I am not sure about CSS. What is the fastest and best way to learn all the commands and what they mean?
I hope I have something to offer back at some point in the future.

grahamstewart

4:29 am on Jun 23, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Nothing wrong with tables. Some people are trying to go all out with the whole CSS2 thing.. tables are the best bet.

Nothing wrong with tables? Eh?

You mean apart from..

  • they are very bulky to code and not very intuitive

  • they don't preserve your document structure

  • they are not accessible to screen readers

  • they force you to mix style and content so you have to change your html whenever you want to change the look of your site.

    The only good time to use a <table> tags is when you actually want a table of information (like a timetable for instance).

    Otherwise, yes, tables for layout are "bad" and should be avoided if possible.

    scockerham its good that you are learning how to code by hand - its the best way to get maximum flexibility and the best understanding of how your site works.

    The fastest way to learn all the commands? I wish I knew.
    Probably lots of experimenting, keep reading these forums (especially the CSS one), download the CSS and HTML4.01 specs from the W3C [w3.org] and keep them handy.

  • trismegisto

    6:06 am on Jun 23, 2003 (gmt 0)

    10+ Year Member



    As graham said: they don't preserve your document structure. Just use tables with tabular data, like with databases:

    Columns are used to specify different type of information. (Age, sex, address, photo)

    Rows are used to arrange that information in individual records (John, Carla, Jules, Martha)

    Hope it helps.

    mattur

    11:37 am on Jun 23, 2003 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    (tables) are not accessible to screen readers

    This is untrue. As long as a table linearises without problems i.e. the table content makes sense when read in the order it appears in the html, there will be no problems.

    Tables do not usually present a problem for screen readers. Try it out for yourself with the downloadable Jaws trial.

    Looking back in time, tables were original implemented for data and for magazine type column layouts. The "tables were only meant for data" meme is a myth. :)

    You may find that using tables results in a more robust, more compatible design for the browsers your visitors use.

    grahamstewart

    2:03 pm on Jun 23, 2003 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    As long as a table linearises without problems i.e. the table content makes sense when read in the order it appears in the html, there will be no problems.

    And if your using a table for layout then what are the chances of that exactly? Very little I would have thought.

    tables were original implemented for data and for magazine type column layouts. The "tables were only meant for data" meme is a myth

    Looking back in time, tables were introduced in html 3.2 in 1997 and even in those bad old days they were warning against using them for layout..

    "[tables] can be used to markup tabular material or for layout purposes. Note that the latter role typically causes problems when rending to speech or to text only user agents." - from [w3.org...]

    These days HTML is supposed to be about pure semantics and document structure, thats why tags like <center>, <font>, <b>, <i> etc have been deprecated and thats also why tables should only be used for tabular data.

    mattur

    3:47 pm on Jun 23, 2003 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    Tables usually linearise ok - try it out for yourself with a screen reader or text only UA, rather than repeating what the shadowy w3c say ;)

    I'm just trying to put the pragmatic side here: there's what the w3c say, and there's what works in the real world.

    For most web sites trying to be "semantic" will be a complete waste of time - unless there is some reson to use semantic markup eg sector-specific widely implemented industry standard DTDs, which there isn't. So currently everyone's making up their own semantics, which rather defeats the point (I'll stop now to prevent this thread going wildly off-topic :))

    grahamstewart

    10:46 pm on Jun 23, 2003 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    Tables usually linearise ok - try it out for yourself with a screen reader or text only UA

    I have done. :) I downloaded IBM HomePage Reader which is quite a popular screen reader to demonstrate to my client just how badly some of their competitor websites handled screen readers. One of the problem was that they had used tables for layout so you got weird things happening: like the heading for one section followed by the text for another because they had used code like this..


    <table>
    <tr><td>Heading One</td><td>Heading Two</td>/tr>
    <tr><td>Story One</td><td>Story Two</td>/tr>
    </table>

    Properly marked up tabular data works okay because it has proper column and row headings for the screen reader to use when identifying its position in the table (e.g. it might say "Product: Widgets", "Colour: Blue", "Number: 5")

    For most web sites trying to be "semantic" will be a complete waste of time

    I completely disagree. I'm not talking about producing a site in your own XML dtd. I'm just talking about having style seperated from content and using HTML that correctly reflects the document structure by using the right tags (e.g. <h1-6>, <strong>, <em>, <p>, <ul>, <address>, <label> etc)

    This is definitely NOT a waste of time. First of all, spiders love it: there is a high content:code ratio and proper tags mean proper interpretation. Secondly, your site starts working on new devices without you doing anything (my current project looks great on a PDA and I've never specifically coded anything to handle it). Thirdly, its so flexible: you can change the look of your site from a single file and you can offer your readers multiple looks depending on their needs.

    sector-specific widely implemented industry standard DTDs, which there isn't

    HTML4.01 Strict [w3.org] works for me pretty well. :)

    mattur

    1:16 pm on Jun 24, 2003 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    A layout table marked up like

    <table>
    <tr><td>Heading One
    Story One</td>
    <td>Heading Two
    Story Two</td>/tr>
    </table>

    Would present no problems. This imho is the more common real world layout eg main content and nav bar.

    It's a shame you chose Homepage Reader as this is not widely used among folks with visual impairments (possibly not at all: it doesn't read emails, OS dialogs, Word docs etc so is a bit useless). Most use Jaws with IE for browsing. Homepage reader may interpret your tabular data markup, but Jaws doesn't AFAICR. I strongly urge you to try it out.

    Good HTML markup and CSS result in good pages: semantics don't come into it. Using <b> rather than <strong>, <i> rather than <em> will increase your content:code ratio ;)

    BTW the html 4 spec does not specify any semantic markup eg what is the standard for marking up breadcrumbs? Are breadcrumbs part of a document or just presentational elements? etc

    So I s'pose the answer to the original question is: some folks think it's fine to use tables, some folks think it really is not! :)

    BlobFisk

    1:44 pm on Jun 24, 2003 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    I have to say that I agree with grahamstewart here. mattur makes some very interesting points, however, I believe that the examples you give are quite limited.

    For example, the example of the heading and the story use for table is a good one. This could quite easily be classed as tabular data.

    However, I belive that scockerham was probably referring to an overall page design using tables. In this case, you generally get a very high spreading of content around the cells, with little of the order that is evident in the example you cited.

    When tables are used for page design, screen reader users have difficulties in associating information. CSS is perfect for this, as it allows for the seperation of design and content. scockerham, I'm afraid that there is no hard an fast rule. Some people agree with non-table based layouts, and some disagree.

    The point about semantics is being taken out of context. The tags mentioned give no real meaning to the text contained in them, so there are no real semantics on the page. However, these tags do have important value in accessiblity, usability and search engine friendliness.

    The idea of the Semantic web as put forward by Tim Berners-Lee is still in a theoretical state. To achieve this a set of schemas need to be created to give meaning to page. This meaning is for use by agents, which in turn allows users to search (using the agents) for information and receive intellegent results.

    grahamstewart

    3:18 pm on Jun 24, 2003 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    Okay - to clarify - I am NOT talking about the "semantic web" concept here. What I am saying is that certain tags have a meaning and if they are used correctly then this meaning can be very useful (especially for accessibility, spiders and cross-browser/platform presentation).

    The tags mentioned give no real meaning to the text contained in them

    I'd disagree there. I'd say all Strict tags give some meaning to the text that they contain. Surely thats the point.

    Using <b> rather than <strong>, <i> rather than <em> will increase your content:code ratio

    Depends how you count it really - its the same number of tags and attributes, just a different number of bytes. ;)

    BlobFisk

    3:57 pm on Jun 24, 2003 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member




    I'd disagree there. I'd say all Strict tags give some meaning to the text that they contain. Surely thats the point.

    I don't know. We may be disagreeing on semantics here ( ;) ), but surely the tags mentioned give emphasis and weight to text, but no real meaning?

    <strong> says to me that the text is important or carries weight in some way - it does not give any real meaning to or explaination of the text it applies to.

    grahamstewart

    11:47 pm on Jun 24, 2003 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    Well, it doesn't tell you why the text was emphasised, but thats not its purpose.

    The purpose of HTML is to define meaning in terms of document structure.

    "this text is important" (em,strong)
    "this is a header" (h1-6)
    "this is a table" (table)
    "this is a quote [from this source]" (q,blockquote)
    "this is a link to something" (a)

    etc

    What is actually in these tags is largely irrelevant (provided it complies with the DTD).

    Likewise if you had an product catalog with an XML schema it might define meaning in terms of a product..


    <product>
    <name>Widgets</name>
    <colour>Blue</colour>
    <size>Quite Big</size>
    </product>

    But it doesn't tell you what a widget is or why its quite big and blue.

    hope I'm making sense here...