-
1. Re: Tables - Staying, or on the way out?
{sitewide} Jan 1, 2010 8:19 PM (in response to lifeguardlloyd)tables have thier place, but they are on the way out for sure. You will still see alot of tables out on the streets, which is why there is so much badly coded websites. CSS is here and it is the most efficient way to design. Some will argue this, but it is those who have not mastered the art of css and fall back to old school way of doing code.
Tables should only be used for tubular data...period. Even then (divs) and css can very easily handle any task tables can. Don't follow the path of old school code because you might think CSS is tricky to master. Take the time....learn it...master it. It is really not as hard as it may seem at times once you wrap your mind around it.
Again...if you still see old school code then it is from old school designers stuck in old school ways.
-
2. Re: Tables - Staying, or on the way out?
John Waller Jan 1, 2010 10:55 PM (in response to lifeguardlloyd)For page layout purposes, tables are out. CSS is in.
For presentation of tabular data on a web page, tables are still a good tool and will be around for many years to come.
-
3. Re: Tables - Staying, or on the way out?
lifeguardlloyd Jan 2, 2010 7:51 AM (in response to John Waller)What is the issue with tables? They can be styled with css. I'm not looking to defend one or the other, just trying to understand the debate.
LP
-
4. Re: Tables - Staying, or on the way out?
martcol Jan 2, 2010 9:06 AM (in response to lifeguardlloyd)Two things I'm aware of.
1) Tables take a lot more HTML to execute if used for positioning.
2) Using tables to hold information other than tabular data is not semantically correct. So, just as a <p> should have text in it, a table should have a table in it.
Martin
-
5. Re: Tables - Staying, or on the way out?
mhollis55 Jan 2, 2010 9:24 AM (in response to lifeguardlloyd)Tables are essential for tabular data in your website. Anything you would want formatted using a spreadsheet is perfect for tables. I would hesitate to place any data like the Recovery Act Jobs Created by State list in anything other than a table. I also note that the table is the result of a Microsoft Excel spreadsheet, where one can do a column sort before posting the table.
Here's some of the code:
<div class="r-headline"><div>Most Jobs Created by State</div></div> <div class="r-content"> <table class="r-chart" xmlns:ms="urn:schemas-microsoft-com:xslt"> <thead> <tr class="text_view_header_row"> <th scope="col">Rank</th> <th scope="col">State</th> <th scope="col" style="text-align:right;">Jobs Created/Saved</th> <th scope="col" style="text-align:right;">Unemployment Rate</th> </tr> </thead> <tbody> <tr class="oddrow"> <th scope="row" class="first">1. </th> <td>California</td> <td style="text-align:right;">110,185</td> <td style="text-align:right;">12.2% </td> </tr> <tr class="evenrow"> <th scope="row" class="first">2. </th> <td>New York</td> <td style="text-align:right;">40,620</td> <td style="text-align:right;">8.9% </td> </tr> <tr class="oddrow"> <th scope="row" class="first">3. </th> <td>Washington</td> <td style="text-align:right;">34,517</td> <td style="text-align:right;">9.3% </td> </tr> ...You will note that they have a class for even and odd rows that is defined in CSS to allow the tabular data to be seen better.
I also like to use tables to format things like a "Contact Me" form because I can then place that table anywhere I would like on the page as a unit.
If you do bulleted lists in Dreamweaver and those lists are to the right of an image, the bullets tend to appear on top of the image. I have used tables to properly place a bulleted list far enough to the right so that the bullets stay away from the image, though one can set up one's style sheet to include enough room to the right of the photo on the page.
So tables are deprecated by things you can do with CSS in terms of laying out your page and setting up <div>s to hold your text and images. But this is not to rule them out entirely. They're quite useful for many things and, thus, allowed in the most strict HTML 5 web pages by the W3C:
Tables should not be used purely as a means to layout document content as this may present problems when rendering to non-visual media. Additionally, when used with graphics, these tables may force users to scroll horizontally to view a table designed on a system with a larger display. To minimize these problems, authors should use style sheets to control layout rather than tables.
The W3C offers a number of notes on Tables and how to make them accessible and how to make them work. The biggest problem with using tables to lay out one's entire web page is that it makes the page almost utterly inaccessible to people who cannot see and who are using screen readers to describe the page. Accessibility is something the W3C is very concerned about.
-
6. Re: Tables - Staying, or on the way out?
David_Powers Jan 2, 2010 10:42 AM (in response to lifeguardlloyd)lifeguardlloyd wrote:
What is the issue with tables?Others have already given you a good summary of the situation. What it really boils down to is the fact that, for many years, tables were the only way to give structure to a web page. Support for CSS was buggy and inconsistent. With the release of Internet Explorer 8 almost a year ago, all major browsers now have excellent support for CSS. So, the rationale for using tables for layout has disappeared. Unfortunately, many people have become so used to using them, they have difficulty in making the transition to CSS.
Using CSS for layout is not so intuitive as seeing a table grid in your HTML editor. However, what many table layout advocates seem to forget is that, apart from very basic layouts, using tables is quite a complex process. Tables end up being nested inside other tables, often several levels deep; and column widths are controlled by transparent images. This makes web pages difficult to maintain, except perhaps by the original designers. More important, they are usually impossible for blind people using assistive technology to navigate.
Anyone learning to build web pages these days should go straight to CSS layout, and leave tables for the display of data.
And, yes, I know that a lot of people still use buggy browsers, such as IE6 and IE7, but most of the bugs have workarounds, and it's not necessary for pages to look pixel-perfect identical in every browser.
-
7. Re: Tables - Staying, or on the way out?
Nancy O. Jan 2, 2010 1:14 PM (in response to lifeguardlloyd)CSS is preferred for general layout purposes. But every so often, you'll encounter a situation for which CSS alone has no solution. Remain flexible. Think outside the box if you can. But don't beat yourself up if you CAN'T AVOID using a table.
This is an amusing article from 2004. Note: that browser support for CSS is much improved now.
Tables Vs. CSS - A Fight to the Death
http://articles.sitepoint.com/article/tables-vs-css#
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
www.alt-web.com/
www.twitter.com/altweb
www.alt-web.blogspot.com -
8. Re: Tables - Staying, or on the way out?
John Waller Jan 2, 2010 2:47 PM (in response to lifeguardlloyd)"What is the issue with tables? They can be styled with css. I'm not looking to defend one or the other, just trying to understand the debate."
Some would summarize the reply to this question as the introduction of a school of thought collectively known as web standards.
See http://www.hotdesign.com/seybold/everything.html for an overview based on issues faced by the web design industry several years ago.
-
9. Re: Tables - Staying, or on the way out?
{sitewide} Jan 2, 2010 7:54 PM (in response to Nancy O.)@Nancy
sorry but for the life of me I have never encountered an issue with css that I have had to use a table to solve. Not sure what you meant by that. With the right training css can handle any phase of web design. With CSS3 it even opens the door to a whole new arena of imagination. So if css can't handle your design then NOTHING can....or you might need to study up on the true depth of css.
-
10. Re: Tables - Staying, or on the way out?
lifeguardlloyd Jan 2, 2010 8:47 PM (in response to {sitewide})Wow! Great debate and food for thought. I have decided to embrace css, however not over night. I have been working with tables too long. It's ironic that you can style tables with css. For the record I do use css, just not at the level of Zen Garden. Thank you all who have answered this question.
LP
-
11. Re: Tables - Staying, or on the way out?
John Waller Jan 3, 2010 2:47 AM (in response to {sitewide})With the advent of CSS3, we're certainly approaching the time when CSS can handle any formatting issue thrown at it but we're not 100% there yet, especially with browser support.
Some interesting discussions here:
http://stackoverflow.com/questions/750779/what-cant-be-done-using-css
http://stackoverflow.com/questions/522928/can-you-do-this-html-layout-without-using-tables
Nevertheless, my workflow certainly starts with CSS, knowing that tables offer me other solutions if necessary although I rarely use them. Complete opposite from a few years ago.
-
12. Re: Tables - Staying, or on the way out?
David_Powers Jan 3, 2010 2:59 AM (in response to lifeguardlloyd)lifeguardlloyd wrote:
It's ironic that you can style tables with css.
Not really. Tables are an integral part of HTML, and need to be styled. Here are just a couple of examples of styling tables, taken from my book, Getting StartED with CSS:
-
13. Re: Tables - Staying, or on the way out?
Nancy O. Jan 3, 2010 4:30 PM (in response to {sitewide})sitewidecf,
sorry but for the life of me I have never encountered an issue with css that I have had to use a table to solve.
Lucky you. You haven't been doing this long enough.
So if css can't handle your design then NOTHING can....or you might need to study up on the true depth of css.
Rubbish. I am keenly aware of the pow, pow, powers of CSS - 1, 2 & 3.
Suffice it to say that if tables and divisions were interchangeable, converting table-based layouts to CSS would be dirt simple. But it doesn't work that way. Divisions and tables have different characteristics; some desirable, some not. Web browsers treat content inside tables and divisions differently, too. So when faced with a need for a stable container that behaves like a table, use a table. No harm, no foul, no deep sense of shame involved.
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
www.alt-web.com/
www.twitter.com/altweb
www.alt-web.blogspot.com -
14. Re: Tables - Staying, or on the way out?
Nancy O. Jan 3, 2010 4:35 PM (in response to David_Powers)Here are just a couple of examples of styling tables, taken from my book, Getting StartED with CSS:
David, I'll bet you had a blast developing the demos for this book.
Nice work!
-Nancy O.
-
15. Re: Tables - Staying, or on the way out?
{sitewide} Jan 3, 2010 5:43 PM (in response to Nancy O.)@ nancy
Your are right...I have not been doing this that long. Only about 8 plus years and learned with css. So lucky for me I have never implemented old school habits for bailing out of a design with tables.
Tables are stable within browsers only becasue they have default margins, borders padding so on and so forth. Those all can be wiped clean with css and make them just as useless as a non styled div. Likewise a div can be made to behave like any stable table can with css.
<td></td>
is the same as
<div></div>
if the css is styled to make them the same.
If you think otherwise then please give me an example of a situation (outside tubular data, but css can handle this as well) were a table is needed over the use of div's and css.




