-
Too many tables
I was reading an article about Bad website design and a list of No-nos included "Too many tables."
The author didn't say how many was too many nor why too many tables was "bad design."
Any suggestions? How many are too many and why are too many not good? Or was that bad advice?
-
Depends on the purpose of the site or page. Tables shouldn't be used for layout. It's how sites used to be built, but the better way to build a site is to use a combination of html and css. html for the structure and css for the presentation. One table used for the layout of a web page is one table too many.
However tables certainly have their use. If you're presenting tabular data for your content then it's completely appropriate to use a table for that data. There's really no limit to how many of those tables you can use. It depends on the content itself. If you're writing an article that compares information from 15 sets of data then use 15 tables to display that data.
I can't tell you whether or not the information in the article you read was good or bad without reading the article, but the general advice not to use "too many tables" doesn't really make sense. It depends on the context you're using them.
For layout you should use exactly 0 tables.
For tabular data you should use as many as you need for your specific content.
-
Vangogh,
I think you are a little strict on the no layout tables rule. I agree you should not use table multiple layers deep, a single or dual layer table should not cause any issues.
Definatly avoid using tables that are several (>3) layers deep for any reason.
-
For the most part, the only reason to use tables for layout is not knowing CSS. Tables can also present maintenance problems. Suppose you want to insert a "cell" between two others in a 3 column layout. There are tools to make this easier, but it presents coding issues you would not have to worry about using CSS. Style based pages are easy to update and maintain, table based pages can become labor intensive.
-
Sorry nealrm, but I'm not being strict at all about the tables. Using tables for a layout is not the right way to build a site. Even a single table causes problems.
They take longer to load in a browser
They make it much more difficult to maintain a site
They make it more difficult to control the layout
I'll go as far to say if you hired a developer who builds your site with tables you've hired a poor developer. Sorry, but I'm not being hard at all. Tables are not the way to build a site layout. Table based layouts are a legacy hack when there wasn't a better way. A very clever and useful hack at one time, but one that is no longer necessary and no longer recommended. Quite honestly the only people you see using tables for layout today are those who aren't willing to take the time to learn css and layout a site the correct way.
Feel free to use tables. You can certainly make a site layout work using them. But over the life of the site you'll spend more time and money making changes to the site and you'll probably run into more problems with your site not quite displaying the way you want.
You can force a nail into a wall using a screwdriver, but that doesn't mean you should use one to drive a nail. You should still use a hammer.
-
I think i would tend to agree with Vangogh on the tables issue, the primary reason is that even using just a table in the normal content to show a little data, can sometimes cause problems trying to get the open and close right for the start and end of a table, and then when you start to use it for the layout as well as displaying data in the content, it can get messy, and for larger pages within a site if they have a few tables it can get quite hard to find which open or close is affecting your design sometimes.
-
Granted this isn't scientific, but every developer I've ever known who knew how to build sites with either css or tables, chooses to build them with css. And every person I've ever encountered who defended tables didn't really know how to develop an all css layout by their own admission.
CSS layouts are simply a better way to develop websites, which is why you should use exactly 0 tables in your layout.
-
Thank you, guys - very interesting.
-
Frederick, do you have a link to the article you read? It would be interesting to read. I know why css is better to use than tables for the layout of a website, but I'm always curious as to the reasons others give.
-
A few years back I read an article on a web design site stating that while css was better, they continued to use table layout because of cross browser support issues.
I just took a quick look at the source for a couple of large sites that I know were using tables a while back. This includes several large news sites as well as yahoo. All are using css today. When exactly they made the change, I'm not sure. When the big boys start using css for layout, you know its time to make the change as well.
That doesn't mean you shouldn't use a table for tabular data though. I can't see that ever hurting you. I haven't seen anything indicating its going to be phased out either.