Top 10 CSS Table Designs
By R. Christie
Tables have got to be one of the most difficult objects to style in the Web, thanks to the cryptic markup, the amount of detail we have to take care of, and lack of browser compatibility. A lot of time could be wasted on a single table although it’s just a simple one. This is where this article comes in handy. It will show you ten most easily implemented CSS table designs so you can style your tables in a zap!
First things first
We start with a valid xhtml 1.0 strict markup. Here is an example of a valid table markup:
<!-- Table markup-->
<table id="...">
<!-- Table header -->
<thead>
<tr>
<th scope="col" id="...">...</th>
...
</tr>
</thead>
<!-- Table footer -->
<tfoot>
<tr>
<td>...</td>
</tr>
</tfoot>
<!-- Table body -->
<tbody>
<tr>
<td>...</td>
...
</tr>
...
</tbody>
</table>
You can read more about xhtml table markup in HTML Dog’s Table Section. I have tested the tables below in Mozilla Firefox 3, IE 6 and 7, Opera 9.x and Safari. Also note that I apply a light blue color scheme to all of these tables to give the article a consistent look. You can modify the color scheme to match your site — the source package is provided in the end of the article.
Before we start, let’s review the general rule of thumb for styling of tables:
- Tables love space. Set the width of tables carefully, according to the content. If you don’t know the perfect width, simply set the
widthof thetableto100%. Tables look nicer when they have “overwidth”, and when it comes to tables too much width is definitely better than too little width. - Cells need some padding. Sure, each table cell relates to each other. But it doesn’t mean that we have to pull them too close, right? Define some space between the cells, crammed up table cells are so much harder to read.
- Treat tables the way you treat content. Tables are read similarly to the way we read text — except it’s harder and it takes more time to read a table. So be careful with the amount of contrast you are giving to your table. Use soft colors — it’s easier for the eyes. Don’t treat your table like it’s a graphical decoration. Make sure that the style you apply to it makes the content more readable, not the other way around.
Now that we are all set up let’s get going, shall we?
1. Horizontal Minimalist
Horizontal tables are tables that are read rather horizontally than vertically. Each entity is represented by a row. You can style these types of tables with minimalist style. Simply set enough padding to the cells (td and th) and put a 2 pixel border underneath the header.
| Employee | Salary | Bonus | Supervisor |
|---|---|---|---|
| Stephen C. Cox | $300 | $50 | Bob |
| Josephin Tan | $150 | - | Annie |
| Joyce Ming | $200 | $35 | Andy |
| James A. Pentel | $175 | $25 | Annie |
Because horizontal tables are supposed to be scanned horizontally, clearing the border of the table increases the efficiency of the table. The lack of border, however, makes this table design hard to read if it has too many rows. To counter it we simply add 1 pixel border underneath all td elements:
| Employee | Salary | Bonus | Supervisor |
|---|---|---|---|
| Stephen C. Cox | $300 | $50 | Bob |
| Josephin Tan | $150 | - | Annie |
| Joyce Ming | $200 | $35 | Andy |
| James A. Pentel | $175 | $25 | Annie |
The tr:hover rules are very useful to aid people reading a minimally designed tables. When the mouse cursor hovers over a cell, the rest of the cells in the same row highlights immediately, making it easier to track things if your tables have multiple columns.
- Important!
- Carefully finetune the typography and the padding between the cells
- Pros
- Very easy to style, good for simple tables
- Cons
tr:hoverrules don’t work in IE 6, table can be confusing if it has too many columns- Play with
- Color scheme, typography,
tr:hovereffects
2. Vertical Minimalist
Although rarely used, vertically oriented tables are useful for categorizing or comparing descriptions of objects, with each entity represented by a column. We can style it in minimalistic style by adding whitespace separators between columns.
| Comedy | Adventure | Action | Children |
|---|---|---|---|
| Scary Movie | Indiana Jones | The Punisher | Wall-E |
| Epic Movie | Star Wars | Bad Boys | Madagascar |
| Spartan | LOTR | Die Hard | Finding Nemo |
| Dr. Dolittle | The Mummy | 300 | A Bug’s Life |
Add large border-left and border-right with the same color as background. You can use transparent borders if you want, but IE 6 screws it all up. Since this table is supposed to be read from top to bottom (vertically), adding tr:hover does not help and instead makes it harder to read the data. There is perhaps a Javascript-based solution which enables you to highlight the whole column when a mouseover event occurs, but that’s beyond the scope of this article.
- Important!
- Carefully finetune the typography and the padding between the cells, do not add
tr:hovereffect - Pros
- Easy to style, good for simple tables
- Cons
- Can not be used if background is not a solid block of color, suitable only for some tables
- Play With
- Color scheme and typography
3. Box
The most dependable of all styles, the box style works for all kinds of tables. Pick a good color scheme and then distribute background-color to all the cells. Don’t forget to accentuate the differences of each cell by defining border as a separator. An example of a box style table is the following table:
| Employee | Salary | Bonus | Supervisor |
|---|---|---|---|
| Stephen C. Cox | $300 | $50 | Bob |
| Josephin Tan | $150 | - | Annie |
| Joyce Ming | $200 | $35 | Andy |
| James A. Pentel | $175 | $25 | Annie |
| Comedy | Adventure | Action | Children |
|---|---|---|---|
| Scary Movie | Indiana Jones | The Punisher | Wall-E |
| Epic Movie | Star Wars | Bad Boys | Madagascar |
| Spartan | LOTR | Die Hard | Finding Nemo |
| Dr. Dolittle | The Mummy | 300 | A Bug’s Life |
This style is nowadays probably the most used style. The tricky part is actually trying to find the color scheme that matches with your site. If your site is heavy on graphics, it will be pretty hard to use this style.
- Important!
- Choose a color scheme that matches with your site
- Pros
- Easy to style, flexible for large or small tables
- Cons
- Choosing the perfect color scheme could be tricky
- Play with
- Colors and borders, use
dashedordottedto achieve cute effects, typography, icons
4. Horizontal Zebra
Zebra-tables are pretty attractive and usable. The alternating background color can serve as a visual cue for people when scanning the table. To style a table as zebra, simply put a class="odd" to every odd ordered tr tag and define a style for it (e.g. using if ($count % 2) then even class else odd class in PHP).
...
<tr class="odd">
<td>...</td>
...
</tr>
<tr>
<td>...</td>
...
</tr>
...
| Employee | Salary | Bonus | Supervisor |
|---|---|---|---|
| Stephen C. Cox | $300 | $50 | Bob |
| Josephin Tan | $150 | - | Annie |
| Joyce Ming | $200 | $35 | Andy |
| James A. Pentel | $175 | $25 | Annie |
- Important!
- Do not put too much contrast on the zebra colors, you can blind your users
- Pros
- The zebra pattern can help people to scan the table
- Cons
- Adding
class="odd"manually can be very tedious for large tables, many content management systems do not provide even/odd features on a table loop, hence picking the color scheme may be tricky - Play With
- Contrasting color, borders, typography, icons
5. Vertical Zebra Style
Vertical zebra is easier to style than the horizontal one, as we can make use of colgroup and col elements to distribute column classes. However, the markup becomes a little bit heavier:
<table>
<!-- Colgroup -->
<colgroup>
<col class="vzebra-odd">
<col class="vzebra-even">
<col class="vzebra-odd">
<col class="vzebra-even">
</colgroup>
<!-- Table header -->
<thead>
<tr>
<th scope="col" id="vzebra-comedy">Employee</th>
...
</tr>
</thead>
...
</table>
The colgroup element actually applies a style or class to the table, columnwise. Instead of tediously applying class for the first td or th element, we can use a more convenient colgroup-tag. For more information about colgroup visit this page.
| Comedy | Adventure | Action | Children |
|---|---|---|---|
| Scary Movie | Indiana Jones | The Punisher | Wall-E |
| Epic Movie | Star Wars | Bad Boys | Madagascar |
| Spartan | LOTR | Die Hard | Finding Nemo |
| Dr. Dolittle | The Mummy | 300 | A Bug’s Life |
Although perhaps more suitable for vertically-oriented table, this zebra-style can also be used for any other kind of tables.
- Important!
- Do not put too much contrast on the zebra colors, you can blind your viewer
- Pros
- Suitable for all types of tables
- Cons
- Choosing the color scheme could be tricky, need to add
colgroupelements - Play With
- Contrasting color, borders,
colgroupandcol, icons and typography
6. One Column Emphasis
In some tables, some particular column may have a higher weight than the other columns. If that’s the case, you can use colgroup and col to make that particular column stand out. In the example below, the first column serves as the starting point to read, so it is emphasized, just like we emphasize the first letter of the paragraph as drop caps:
| Company | Q1 | Q2 | Q3 | Q4 |
|---|---|---|---|---|
| Microsoft | 20.3 | 30.5 | 23.5 | 40.3 |
| 50.2 | 40.63 | 45.23 | 39.3 | |
| Apple | 25.4 | 30.2 | 33.3 | 36.7 |
| IBM | 20.4 | 15.6 | 22.3 | 29.3 |
You can also use one-column-emphasis-technique to highlight something important, say the column containing totals of an accounting table, or in a comparison table — for computer specification perhaps, the winning entity (column).
- Important!
- Be careful, don’t overdo the emphasis or the column will jump out, distracting the effort to read the rest of the columns.
- Pros
- Very effective when used in certain kind of tables
- Cons
- The necessary
tr:hovereffect does not work in IE, suitable for certain types of tables only - Play with
- Color scheme, typography, icons and
tr:hovereffects
7. Newspaper
To achieve the so-called newspaper effect, apply border to table element and play with the cells inside. A quick, minimalistic newspaper style can look like this:
| Company | Q1 | Q2 | Q3 | Q4 |
|---|---|---|---|---|
| Microsoft | 20.3 | 30.5 | 23.5 | 40.3 |
| 50.2 | 40.63 | 45.23 | 39.3 | |
| Apple | 25.4 | 30.2 | 33.3 | 36.7 |
| IBM | 20.4 | 15.6 | 22.3 | 29.3 |
Simply play with color scheme, borders, padding, backgrounds, and tr:hover effects of the cells (td and th). Other alternatives are presented below:
| Company | Q1 | Q2 | Q3 | Q4 |
|---|---|---|---|---|
| The above data were fictional and made up, please do not sue me | ||||
| Microsoft | 20.3 | 30.5 | 23.5 | 40.3 |
| 50.2 | 40.63 | 45.23 | 39.3 | |
| Apple | 25.4 | 30.2 | 33.3 | 36.7 |
| IBM | 20.4 | 15.6 | 22.3 | 29.3 |
| Favorite | Great | Nice | Bad |
|---|---|---|---|
| Passion of the Christ | Bourne Ultimatum | Shoot ‘Em Up | Ali |
| The Big Fish | The Mummy | Apocalypto | Monster |
| Shawshank Redemption | Cold Mountain | Indiana Jones | Dead or Alive |
| Greatest Story Ever Told | I Am Legend | Star Wars | Saw 3 |
- Important!
- Be careful with
border-collapse, do not lose the signature border around the table! - Pros
- Gives a royal, authorative aura to a table
- Cons
- Unsuitable for large tables (it loses it’s charm on large tables)
- Play With
- Typography, color scheme, background, border, padding, and
tr:hovereffects
8. Rounded Corner
Rounded corners are slick and modern, and it’s easy to apply it to a table, although you need to fire up Photoshop for this. Create images for all four corners of your table. Theoretically, we can make use of the nesting tr and td-elements to place the left and right corners of the table without adding additional markup. Unfortunately, IE 6 goes berserk and the table appears ugly, so the most stable way to do this is to put ID or class to all four corner cells of the table. Please consider the example below:
| Company | Q1 | Q2 | Q3 | Q4 |
|---|---|---|---|---|
| The above data were fictional and made up, please do not sue me | ||||
| Microsoft | 20.3 | 30.5 | 23.5 | 40.3 |
| 50.2 | 40.63 | 45.23 | 39.3 | |
| Apple | 25.4 | 30.2 | 33.3 | 36.7 |
| IBM | 20.4 | 15.6 | 22.3 | 29.3 |
- Pros
- Great if you want untraditional table, probably the only viable option you have if your website uses rounded corners heavily
- Cons
- Takes longer to style, requires images
- Play With
- Color scheme, corner variations, typography,
tr:hovereffects, icons
9. Table Background
If you are looking for a quick and unique way to style your table, simply pick an attractive image or photo related to the subject of your table and set it to be the background-image of the table. You can add 50% grey png-image as background-image of the cells to improve readability, and that means that you need a CSS-hack to make it work in IE 6:
* html table tbody td
{
/* IE CSS Filter Hack goes here*/
}
The table would look like this:
| Employee | Division | Suggestions | |
|---|---|---|---|
| IE 6 users won’t see the transparent background if the hack is not applied | |||
| Stephen C. Cox | Marketing | Make discount offers | |
| Josephin Tan | Advertising | Give bonuses | |
| Joyce Ming | Marketing | New designs | |
| James A. Pentel | Marketing | Better Packaging | |
- Important!
- Make sure the image is relevant to the table’s contents
- Pros
- Very easy to style, delivers unique look, if used correctly the image can serve as a symbol that gives outstanding impression on the viewer
- Cons
- Needs hack to get the background work in IE 6, needs images
- Play With
- Background images, transparent PNGs, typography, colors, icons
10. Cell Background
You can apply background-image to the cells and achieve a consistent look. Say you have at least half an hour to spare and you want something that’s not too bland. Start your Photoshop and make 1 pixel width gradients, and set them as background-image of all cells. You’ll end up with a gradient style table:
| Employee | Division | Suggestions | Rating |
|---|---|---|---|
| Give background color to the table cells to achieve seamless transition | |||
| Stephen C. Cox | Marketing | Make discount offers | 3/10 |
| Josephin Tan | Advertising | Give bonuses | 5/10 |
| Joyce Ming | Marketing | New designs | 8/10 |
| James A. Pentel | Marketing | Better Packaging | 8/10 |
Similarly, pick a pattern and set it as background-image and you’ll end up with a pattern-styled-table:
| Employee | Salary | Bonus | Supervisor |
|---|---|---|---|
| Stephen C. Cox | $300 | $50 | Bob |
| Josephin Tan | $150 | - | Annie |
| Joyce Ming | $200 | $35 | Andy |
| James A. Pentel | $175 | $25 | Annie |
| Nation | Capital | Language | Unique |
|---|---|---|---|
| Japan | Tokyo | Japanese | Karate |
| South Korea | Seoul | Korean | Ginseng |
| China | Beijing | Mandarin | Kung-Fu |
| Indonesia | Jakarta | Indonesian | Batik |
- Important!
- Make sure the text stands out against the background
- Pros
- Easy to style, not too bland
- Cons
- Uses images, patterns and gradients might distract reading
- Play With
- Color scheme, patterns, typography, borders, backgrounds, gradients, icons
Final Words
I know I barely scratched the surface with this article, so grab the source and play around. Feel free to post your favourite table designs, especially if it’s something I missed out. Over to you.
About the author
R.Christie is studying information systems at college. He viciously juggles activities from college, web design, programming, church, to sport activities. You can say hello to him via e-mail.
Editor’s note
This post is one of the finalists of our guest author contest. Over three weeks selected top-10-lists and discussion articles will be published. To rate the articles we’ll analyze their popularity, users activity, quality of backlinks, traffic and further data.
How good is the post “Top 10 Express CSS Table Designs”?
( polls)





Sean
August 13th, 2008 11:56 amOne of the better guest articles. Tables still suck! :)
Allison
August 13th, 2008 11:58 amanother great post smashing!!! beautiful tables.
TJ Mapes
August 13th, 2008 12:02 pmF*** tables
Steve
August 13th, 2008 12:03 pmTables…… I though tables were bad :) these look very nice though! Good read
Tanner Christensen
August 13th, 2008 12:04 pmTables? Seriously?
mikemike
August 13th, 2008 12:07 pmTerrible. The Vertical Minimalist section displays improper use of tables for non-tabular data. The markup there should be headers followed by unordered lists. NOT TABLES!
Aaron
August 13th, 2008 12:08 pmPraise ye table! :)
Ben Carlson
August 13th, 2008 12:11 pmTables for tabular data, who woulda thunk it..
Good article, some neat tricks, and very nice looking tables.
add
August 13th, 2008 12:11 pm“F… tables”
you retards… Tables are GOOD when dealing with tabular data. pffff
Henry Hoffman
August 13th, 2008 12:12 pmThis is one of the most poorly written articles I’ve read so far. It doesn’t take any time to read through and fix typos and grammar. The content is quite good though.
@ TJ Mapes – Stop being such a purist. Tables are for use with tabular data, DIV’s are for layout.
MikeWhoBikes.com
August 13th, 2008 12:13 pmNow here is a terrific guest article! Very useful and informative, with techniques that I can apply directly to what I’m working on.
A variation on #10, using a gradient background image, is to have the :hover change to a gradient that is vertically reversed. This creates a subtle 3D effect that looks great and really emphasizes that row.
eddie
August 13th, 2008 12:19 pmYou’re darn right about that! :-)
canute
August 13th, 2008 12:21 pmdont know why they insult tables
i mean
web depends a lot of it years ago
that tool help us before get freaks about divs
besides, tables reminds me to net art
thanks!
keep posting
Gary
August 13th, 2008 12:24 pmOverall, a nice simple article on tables. Author seems to have forgotten all about the table though.
add
August 13th, 2008 12:26 pmyou can fake tr:hover in IE6 with a little JS:
onmouseover=”this.className=’trhover’” onmouseout=”this.className=’trdefault’”
Gary
August 13th, 2008 12:26 pmOoops. I used HTML… thats a no-no. I meant to say “seems to have forgotten all about the table caption tag though”.
Ben
August 13th, 2008 12:29 pmTo the other commenters, this isn’t tabled layout, this is tables for tabular data – the true and semantically correct purpose of the HTML table.
Know the difference.
AK
August 13th, 2008 12:38 pmBrilliant, learning more all the time!
juzek
August 13th, 2008 12:39 pmCSS kids.. tables do not sucks. Tables are for “tables” – not for design. Great article.
Moritz GieĂźmann
August 13th, 2008 12:39 pmI love this article! One of you said “tables suck”, but not in this way!
Chris
August 13th, 2008 12:43 pmTables for tabular data == good
Tables for layout == bad
Parroting “tables suck” betrays your lack of understanding of the semantic, not presentational, intent of the table tag. I would argue that, in the interest of a semantic web, using the table tag (and all of the other associated tags like tbody, table headers, the summary attribute, etc.) is better than a pure CSS table.
Abdulsalam Alasaadi
August 13th, 2008 12:44 pmGreat Post.. keep it up.
paul
August 13th, 2008 12:51 pmI don’t like tables at all, but is something you must use sometimes, so the examples above are real useful, I Love you site, on of the best ones for Web Developers, Thank You!!!!
Jimmer
August 13th, 2008 12:53 pm“Start your Photoshop and make 1 pixel width gradients, and set them as background-image of all cells.”
A minor quibble:
Historically, a 1-pixel-wide (or high) background was not advisable as it caused memory and processor problems. (I distinctly remember watching some 1-pixel backgrounds take a minute or so to load!) While computers and browsers are better, I suspect it’s still advisable to make backgrounds more like 12 pixels (if you can) to lighten the browser’s load. And it doesn’t add a lot to bandwidth.
Max
August 13th, 2008 12:55 pmOne of the best guest articles so far.
Very informative and helpful!
Jason
August 13th, 2008 12:56 pmExactly. Using tables for data is the best thing. Using tables for layout is the worst thing.
This article is really useful, complete and well done ! More more more please !
ClearStyleSheet
March 6th, 2010 1:37 amI agree about this!
All those table-haters still dont see that tables used for complete layouts are bad design issue, not the tables used to display data structures. I would like to see what those people look like, when they have to display complex tables, with several row- and colspans. Dont you think, Google would use tables, if it was better – or easier to use divs instead? I guess professionals should understand the difference between tables used to display data, tables to layout a website and tables with four legs. :)
Whith a litte smile on its face…
CSS
Lukas
August 13th, 2008 12:58 pmGreat article!
I’m still using tables to represent data, and this is a good way to “refresh” my table design.
Really good job
Peter Mularien
August 13th, 2008 1:03 pmGreat article. Kudos to the guest author.
I would love to see a design-focused follow-on done in typical SM style providing a survey of the “n Best Table Designs” that highlights attractively designed tables. The CSS Table Gallery is the only design resource featuring tables that I’ve encountered so far.
mac_fun
August 13th, 2008 1:11 pmGreat one! Thanks!
kate
August 13th, 2008 1:16 pmtables still give me a hard time. good post!
Andrew Miguelez
August 13th, 2008 1:32 pmAll of you people complaining about the use of tables are so pathetic. Try to pay attention here, this is important: tables are still necessary and very useful for presenting and organizing sets of data. That’s their purpose in the first place! However, table-based layouts are bad and hinder the use and benefits of CSS designing.
Did you get all of that? I hope so because this is a fantastic article! Props to the author. Definitely one of the best guest posts thus far. Thank you for sharing!
-Andrew
Cosmi
August 13th, 2008 1:34 pmNo no, table not sucks!
Don’t understand wrong the tables.
Tables is only for tabular data.
Anyway, great article, thanks Christie!
psiberia
August 13th, 2008 1:36 pmNice article, one of the better ones in recent days.
Grats! First time I have seen colgroup used. Still a shame “rowgroup” doesn’t exist, and still won’t from the spec on HTML 5. Would save coding a modulo to alternate classes…
Dimitry Wolotko
August 13th, 2008 1:44 pmI’m logn try doit item number nine easy – and i’am find this – thanks!
Joep
August 13th, 2008 1:45 pmTables are not bad. They just need to be used for what they are invented for, ehh… tables. Use divs for the layout
rerich
August 13th, 2008 1:50 pmgreat !!!
jordan
August 13th, 2008 1:54 pmI don’t understand these anti-tables remarks, yes they are useless for layout but still absolutely necessary for correctly displaying accessible tabular data. Bookmarking this, excellent examples.
JL
August 13th, 2008 1:56 pmOne of the better guest articles…
But I can’t give it 5 stars because there are no such things as “vertical tables,” they are merely columns of lists (which should use
ulorol).Thomas Dedericks
August 13th, 2008 2:03 pmI totally stand by the principle. Using tables for layout in 2008 is bad.
But (unfortunately) tables for layout might still be the most efficient solution in some particular cases: same height columns with flexible widths, vertical alignment, etc. This is due to an incomplete support of CSS specifications by the most common browsers (not only IE6, for once).
My point is: sometimes, “tableless fanatism” just causes headaches. Not worth it ;)
Nice article, by the way :)
Jahdog
August 13th, 2008 2:05 pmGreat article.
sometimes Table is the best tool for job….they don’t suck just for being….unlike IE
Laura
August 13th, 2008 2:08 pmBest guest article so far.
Nice to see one that isn’t just brief text done in 5 minutes, but with useful illustrative images and html/css.
Benni
August 13th, 2008 2:11 pmGreat article. I almost forgot how to use tables since I don´t use them anymore for design purposes.
Dan
August 13th, 2008 2:12 pmSM should place the ads and other content on the right into a table and delete it…. I waste 2 seconds of my life every time I visit… and if I scroll before its done loading… ZOMG!
Stephan
August 13th, 2008 2:24 pmOldschool, cool!
But “table” in uppercase please!
Since clients needs stuff like “the whole row is a link but the column ‘taxes’ must be have a special handle” i use “position:block”ed built tables via …. runs fine,is enough and more flexi.
Chris Murphy
August 13th, 2008 2:25 pmNice. Finally a sensible example on how to use tables for real-world applications.
Stephan
August 13th, 2008 2:26 pmsorry , no ecaped tags in the end of text below.
Bob
August 13th, 2008 2:35 pmCSS3 selectors render ‘class=”odd”‘ useless. Just use tr:nth-child(odd).
Firehed
August 13th, 2008 2:39 pmIf you need to build a decent email-based newsletter, you’re more than likely going to go with tables.
dirk zaal
August 13th, 2008 3:16 pmFinally the taboo out in the open: we can not really without TABLE , nobody in the business dare to write about TABLE
excellent subject and story.
curious for your next subject!
Maverick
August 13th, 2008 3:23 pmNice article, good to show certain twits in these comments what tables are actually supposed to be used for.
Jaclyn
August 13th, 2008 3:30 pmNo one asked if the content in the tables was ‘table data’. The concept is to show how to display nice tables and have the code be correct.
Wonderful article. This is my winner until now!
Keith
August 13th, 2008 3:45 pmFantastic article!! Great job
martin
August 13th, 2008 3:48 pmwhy anyone would want to win a macbook air is beyond me but anyways…
this article seems to be a more basic version of an article did almost a year ago… nothing new here…
Rom
August 13th, 2008 3:54 pmcool article, yeah tables really do eat a lot of time in designing them.
thanks for this smashing article! :)
Daniel
August 13th, 2008 4:13 pmThe people who are saying fuck tables are stupid.
No wonder this website doesn’t post code articles, apparently most of the readers are mentally disabled
Tables are NOT a deprecated tag. They are perfectly fine for displaying tabular data, just not for layouts. I can’t believe I’m reading comments like that
Hector Rojas
August 13th, 2008 4:38 pmTables got to be
are you serious? Any article starting with such horrendous grammar is a no-no in my book.
I guess they don’t teach or require you to read and write correctly in College anymore…
AvantisOne
August 13th, 2008 4:45 pmDude, No one uses tables. Try some CSS, my friend.
Matthew
August 13th, 2008 4:46 pmOne of the better posts, I really like this. CSS tips ftw. :)
h-a-r-v
August 13th, 2008 4:59 pmSimply pro. My second highest rate.
Karan
August 13th, 2008 5:10 pmReally informative….till now i thought table is of no use for designing. This article has made be believe that tables can be made to look beautiful. Nice article
Smashing Magazine rocks as always!!
Ben
August 13th, 2008 5:15 pmLooking at all the “F** tables”, “OMG tables u serious”, “Tables are bad, mmkkay” comments I wonder if any of these posters have actually understood what tables are meant to be used for. They’re meant for *cue drumroll* tabular data, which is exactly what this article shows. No one said they have to look butt ugly doing so.
Stop screaming “tables are bad” just because you “heard” or “read it somewhere”. The element exists for a reason and a very good one at that. Any Web-standards or CSS book will tell you that, read them.
Ben
August 13th, 2008 5:18 pm@AvantisOne – Have you actually READ the article, let alone understood the TABLE element and it’s intended use. On top of that what do you think this article uses to style the tables.
Think for a second before you hit the comment button next time.
Christian
August 13th, 2008 5:21 pmGreat article, beautiful tables. Thanks!
Mila Jones
August 13th, 2008 5:23 pmGreat article!
I’d like to see an example of how the ‘table-haters’ manage their tabular data. Ignoring a completely valid method of organizing data for the sake of argument screams noob to me. Did I mention properly formatted tables are consistent in all browsers?
Tables are for tabular data, divs are for layouts.
As for grammar… give me a break… you shouldn’t dismiss a great article because of a few grammar mistakes. The author spent a lot of time crafting a great post to share their knowledge with the community, and everyone is so quick to criticize. Where’s your article?
I smell a little jealousy….
Anyway, keep up the great work!
Mariella
August 13th, 2008 5:24 pmExcellent guest article. Thanks.
jayhan
August 13th, 2008 6:07 pmLearnt something here, thanks for the great post
Donna
August 13th, 2008 7:24 pmI enjoyed this article and learned some new techniques. I get quite bored quickly with tables and unfortunately I have a lot of them to style for tons of monotonous data. So this was inspirational and I can’t wait for the next one on this topic.
Violeta
August 13th, 2008 7:52 pmAbsolutely great! ñ_ñ
shakes
August 13th, 2008 7:56 pmgreat article…i like the new technical development slant these days…
abdullah alaydrus
August 13th, 2008 7:56 pmnice article when work with a lot data area, but not to usefull when working with design.
and it’s better guest author articles
Carl Youngblood
August 13th, 2008 8:27 pmThere is one major problem in many of these examples. Numbers should almost always be right-aligned, so that people can quickly and easily see the relative magnitude of a number compared to the others in the chart. This is the way spreadsheets and ledgers do it, for good reason.
Jeremy Brown
August 13th, 2008 8:40 pmI’d much rather apply zebra rows using protype or another AJAX function than have to wrtie a class on every second row.
Plus you get the benefit of sorting large tables of data without having to reload the page.
http://www.frequency-decoder.com have a couple of great table examples but the one I use is
http://www.frequency-decoder.com/2006/09/16/unobtrusive-table-sort-script-revisited
Mithun Sreedharan
August 13th, 2008 8:52 pmGreat words! Beautifully written!
adapter
August 13th, 2008 9:23 pmnice article…very very useful for tabular data.
NissenPaaHaaugen
August 13th, 2008 9:24 pmWhy does 90% of these table designs remind me of Office 2007 Word’s new styles?
Natrium
August 13th, 2008 9:36 pmThis article is great! This is what I expect from Smashing Magazine!
cemagraphics
August 13th, 2008 9:48 pmvery good article, thanks ;)
Rom
August 13th, 2008 9:53 pmTable examples presented here are for data only. So for those zealous web standards people, it will never hurt usability for presenting data. Just don’t use them for layouting, such an eyesore for those who were obsessive looking at your source page. Less is more! :)
Murtuza
August 13th, 2008 9:54 pmGreat article….
I like this article !…post some more article on Table.
Thanks Christie
gaurav_m
August 13th, 2008 9:57 pmnice tables :)
rajaraman
August 13th, 2008 10:01 pmbeautiful tables,
Ruan
August 13th, 2008 10:34 pmThe only time I’ll ever use tables is for this purpose! :)
Good post
Saeed Al-zahrani
August 13th, 2008 10:39 pm@ Jimmer
You are absolutely right , we should consider the performance while working on tables.
It also advisable to style rows rather than cells specially if you are going to use image as a background.
(this is one of the best articles)
Curt Simon Harlinghausen
August 13th, 2008 10:44 pmI like this article. Great job.
fredjaillet
August 13th, 2008 11:17 pmSee a jquery plugin for a tablesorter and zebra…
jquery tablesorter
V1
August 13th, 2008 11:53 pmtables suck…
no matter how u style them, enjoy your fail whale.
Angela
August 14th, 2008 12:00 amNot a bad article but way over the contest’s character limits. I think some of the other entries could have been better had they been allowed the character count that this entry used.
Dresah
August 14th, 2008 12:04 amExcellent work.
Quoo
August 14th, 2008 12:05 amLe table de err… victory or something … like that.
Do you noobs never have tabular data to display? Tables don’t suck, they should just be used for what they were intended.
Great article, tyvm.
Carlton Dickson
August 14th, 2008 12:09 amThe first few comments in this article about tables sucking upset me, when displaying rows and rows of data tables are semantically the correct way to go.
Excellent article with some great table designs, will definitely come in handy in the future!
Julien
August 14th, 2008 12:09 amGreat article !
I just can’t understand why to advocate CSS hacks in the 9th solution. In this case, CSS conditional comments would have been the best solution instead of this uggly
* html table tbody tdPez
August 14th, 2008 12:24 am@ All the ‘tables fail’ crew (who also seem to be the ones with the poorest grammar and spelling and the lowest comprehension skills) – have you ever put a blind person with a screenreader in front of a css based table? The screenreader will read the first row, then the second row, then the third row, and so on. Only with (properly marked-up) tables can you properly define the relationship between table headers and content. Read this before getting on your ill-informed high horses:
http://www.webaim.org/techniques/tables/
Adam Alyan
August 14th, 2008 12:31 amBest guest article yet!
I can’t understand the comments about how bad tables are! Tables had a useful use, the writer didn’t say use tables for page structure.
Tables are good as tables!!!
Mike
August 14th, 2008 12:43 amGreat article Smashing as always, but why does everyone have so much resentment for tables? Have they done something wrong?
Just because we’ve all learnt div positioning that means we can say they ‘suck’? They don’t, when used in an appropriate context. Also, it is still the only way to create any level of layout within an e-mail.
So just think…before you go writing off all those little tags you saw when Saving for Web and didn’t know what they meant ;)
Jeremy
August 14th, 2008 12:57 amTables do not “suck” when used for what they are supposed to be used for – tabular data. Tables suck when used for layout and slicing – and that is the main reason people dislike tables.
Vitaly Friedman & Sven Lennartz
August 14th, 2008 12:57 am@all: tables are good. If you use them for the right purpose and in the right context — to present tabular data.
zhille
August 14th, 2008 12:58 amGreat guest article :)
It’s funny how some people try to seem intelligent by flaming tables :) very hilarious :)
For big websites with a lot of tabular data, and row/column data, tables are still the only sane way to code. But you only need to code that particular data, not the entire website. BUUUT again, we use CSS not table attributes to style it. Maybe we’ll just need cellpadding, os some small attribute, but that doesn’t mean we’re bad because “tables are history”. Tat means fewer CSS glitches and stuff, we all know and love IE6 :) Those people who flame the author probably never worked on a e.g PHP/MySQL financial website with admin pages and a looot of tabular data…be a little more serious, guys.
So tables are not history, and they do not suck IF USED PROPERLY. Be a little more intelligent, don’t just flame :) Sorry for the long comment
jerry
August 14th, 2008 1:12 amvery good stuff
bruno byington
August 14th, 2008 1:23 amNice Article. Loved it.
Tables still fu***** suck major. I guess I dont like them because I grew up without them and because you can in my graphic design apartment only find chairs. No tables. But sure if your using ‘em for tabular things, then your doing something right. Its jsut so awckward when your actually styling tables or writing it in the XHTML Markup because you know you can only use them for tabular but have seen people eat from the forbidden fruit to layout things with it. Right? Well with me this is always the reason why Im so disgusted by this fruit ;)
LC
August 14th, 2008 1:27 amI can’t wait to see an article here without a comment stating that this is “the worst article ever wrote on this site” or “the most poorly written article so far”.
I thought we French were the only one to complain all the time, look like web designers all have a “French touch” after all ;)
Anyway, great article. I like the rounded corner table, but then you have to specify a fixed width. I didn’t know the tr:hover, great tip.
Dizet
August 14th, 2008 2:09 amPete
August 14th, 2008 2:13 amhey tables were never meant for layout. they were designed for appropriate tabular data and they just became popular for layout before web standards and css.
i’ll find this article very useful some day, thanks
Pixelbaron
August 14th, 2008 4:03 amGod, this ready like a YouTube comments thread. I did not know there are so many gradeschool webdesigners out there ;)
@LC nope, that is us Germans that always complain ;)
Chris
August 14th, 2008 4:17 amA good article on how tables should be used. Tables seem to leave a bad taste in a lot of peoples mouths, particularly standards designers who use CSS and XHTML. However, the table is a good tool at presenting data, if used properly with thead tags, screen readers and search engine spiders as well as the average website user should have no problem in using them.
Tables are bad when designing whole websites with them. Tables presenting data are a good thing.
Phill Pafford
August 14th, 2008 4:29 amNice article,
Have you ever seen Tablecloth ? its a very clean plug-in for a well formatted table.
Also for web-designers who do not like tables and prefer CSS, I would agree for element positioning CSS is the only was but for tablature data such as an excel spreed sheet tables are great do display the data.
–Phill
Henry Hoffman
August 14th, 2008 4:46 amWhat happens if you have a tabular layout?
davez0r
August 14th, 2008 4:48 amBest guest article yet. Something I can actually use!
Ignacio
August 14th, 2008 4:56 amWhen you need a table, use tables! Why not!
Thibaut
August 14th, 2008 5:02 amThe article was quite good and the first comments quite funny, I had a great time reading it.
PS : thanks to the morons, btw, how could we sometime laugh if they didn’t exist ;-)
flasheadito
August 14th, 2008 5:07 amThnks a lot
nice article
Ham
August 14th, 2008 5:16 amI second that. Thanks for helping define the proper use of Tables.
Yes, Tables suck but when used properly they can be very useful.
Mikey
August 14th, 2008 5:34 amGuys, tables are fine for tabular data. In fact using tables when presenting tabular data is the correct way to do it. If your doing it with a fistful of custom classes and ID’s then you’re doing it wrong.
Tables are only bad when used for design layout. Some people still do it and it blows me away how ignorant they are. But this article is showing us some nice ways to present tabular data.
Kudos to the author.
psd2markup
August 14th, 2008 5:35 amGuys, shut up if u don’t know. If you use divs and spans with tons of styling for tabular data, you are nothing but plain snobs.
Tables are good, when dealing with tabular data. They validate, and they can look very good.
ScreenOrigami
August 14th, 2008 5:51 am(zhille et al)
@ all standardistas out there: lean back an rejoice in the thought that those who flame data tables today will most likely have seen the light a year from now, and their flames in this thread will haunt them like zombies in egosurfing hell. :P
Jackson Hyde
August 14th, 2008 6:06 am@AvantisOne
Dude, you’re a moron. Learn to read.
PS. Regarding the Horizontal Zebra style, CSS3 supports ‘Structural Pseudo-Classes’ to achieve what a class of ‘odd’ would achieve:
tr:nth-child(2n+1) /* represents every odd row of an HTML table */
tr:nth-child(odd) /* same */
tr:nth-child(2n) /* represents every even row of an HTML table */
tr:nth-child(even) /* same */
http://www.w3.org/TR/css3-selectors/#structural-pseudos
Jackson Hyde
August 14th, 2008 6:09 am@ Henry Hoffman
Your code won’t validate, it won’t be accessable or scalable and it’ll be very hard to maintain.
Learn to layout your markup using standards compliant ‘cascading style sheets’ (CSS) and you’ll wonder why you ever touched tables (for layout that is).
math
August 14th, 2008 6:29 amC’mon! Some people do not understand the requierness for table. If you have table data then use tables – its semantic! So stop to “Tables are dead” and so on – form follows function.
This is a great article. And it could be rewritten to the “Swiss Army Knife for Tabledesign” ;)
Thanks s lot!
Math
Chris
August 14th, 2008 6:37 amTables are terrible but you sure know how to make them look good. Thanks for the article.
dotNetChris
August 14th, 2008 6:43 amI agree whole heartedly, while it’s nice to see some usage of CSS styling tables properly we don’t need to encourage anyone on the internet to use tables again instead of div’s, p’s and ul’s.
Paul
August 14th, 2008 6:48 amThis is a very interesting article. Although rarely used in design, tables are very useful for data, and must sometimes be used. Very good
Sean Johnson
August 14th, 2008 6:57 amExcellent article. Tables are necessary cornerstone in web design. Not all web sites are blogs or brochures, some are actual web applications that require listing out data, especially in the corporate intranet world where functionality takes a back seat to design OR standards.
Daniel G. Blázquez
August 14th, 2008 7:30 amRevise #2 “Vertical Minimalist” in Opera .. :-)
Davin
August 14th, 2008 8:00 amTables suck for layout. Tables are the best thing for tabular data :D. Thanks!
KangarooDeziner
August 14th, 2008 8:07 amGreat article. I browse the comments and see people saying bad things about tables. Tables aren’t bad. They just have a use. Tabular data. They aren’t meant for the presentation of an entire website. So use tables for tabular data, people.
There are 2 things I think you missed out on here, and they’re both CSS3 specific. These two tricks are obviously not supported by older browsers right now, but I think they’re worth mentioning for future developments.
The first is the psuedo class “nth-child”. You can achieve the zebra striping effect for the horizontal data without adding extra classes this way. You simply use “tr:nth-child(odd)” and apply your styles in your CSS. That simple.
The next deals with rounded corners. In CSS3, it is possible to assign multiple images to the background of an element. The CSS gets a little heavy, but it works. Here’s how it might look…
table {
background-image: url("top_left.jpg"), url("top_right.jpg"), url("bottom_left.jpg"), url("bottom_right.jpg");
background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
background-position: top left, top right, bottom left, bottom right;
}
You just need to remember that the no-repeats and the positions are in the same order as you declare the background images. Like I said, makes the CSS a little heavy, but at least it’s all taken care of in one tag and you’re no longer creating useless div wrapper markup for the 4 different corners.
Again, most of this won’t be widely accepted right now, being new CSS, but I think it’s important to let people know what will be coming with the advancements of CSS and next-generation browsers.
Tim
August 14th, 2008 9:01 amWhat?!?! what about this one: http://www.csskarma.com/lab/csstable/
jordan
August 14th, 2008 10:14 am@Jackson Hyde
Yes it will.
Smarmy
August 14th, 2008 11:12 amYou didn’t know that professional web developers still use tables for tabular data? Seriously?
Mike
August 14th, 2008 11:17 amGreat article, I’m a sucker for statistics so I find I use tables quite a lot, I actually quite like them, just as long as they’re used appropriately.
Does this mean all the people saying ‘tables suck’ etc, are trying to display tabular data using divs and lists?? *snigger* that must be a nightmare, and look great with CSS disabled… Way to completely miss the point!
Ryan
August 14th, 2008 11:40 amThese 130+ comments are precisely why I disable comments on my blog. What a bunch of idiots.
A great article being ruined by dozens of idiots RABBLE-RABBLEing about tables because they heard on a script-kiddy forum that you should never use tables. Gimme a break.
Joseph
August 14th, 2008 12:04 pmAre some of you serious.
The examples are of tabular data and that is what tables are meant for. I know you’ve all heard it time and time again “Tables are bad” and yes they are bad for designing your hole site in tables but as far as displaying actual tabular data, bravo!!! these are the best looking ones around. Thanks!!!
Zarathustra
August 14th, 2008 12:09 pmIncredible comments demonstrating a total misunderstanding of the use of tables to display data. No doubt from 14 year old professional web designers ;)
Jose Sandoval
August 14th, 2008 12:19 pmGreat post! And great looking tables!
Patricia
August 14th, 2008 12:37 pmBeautiful! I am always looking to improve on tables’ designs for my own website and my customers’ These are a godsend, thanks for sharing!
jacksonhyde
August 14th, 2008 2:24 pm@jordan
well I guess you could get table layout to validate, but why the hell would you want to? I only code in XHTML Strict and getting a table to validate in Strict would add hours to my workload.
There is no possible way you can convince me that table-layouts are superior to semantic standards compliant CSS layouts.
SEO is better with CSS layouts, page weight is lower, development is quicker and more logical and maintenance/ammends are easier.
Fred
August 14th, 2008 2:32 pmTables do not “suck”. They are really useful. They may “suck” for when you are doing a layout, but for tabular data they are perfect.
Fred
August 14th, 2008 2:34 pmErm sorry for my post above. I just read the first 20 posts that slammed tables and scrolled down to tell the kids what for. But it seems like some of you have already posted a far more robust defence of tables later down the page.
Scott
August 14th, 2008 3:44 pmI’m confused, what’s all this people are saying about “pure CSS” tables? Why would you even consider using divs instead of tables? Incidentally, “pure CSS” is a horrible phrase. No web page can be pure CSS, you need HTML! ;)
For those unsure of the various table tags used here (and the several other possibles), there is a table tutorial here.
Scott
August 14th, 2008 3:50 pmOops, meant to say “there is a tutorial here”.
@jacksonhyde: table layouts can validate with absolutely no problems. Just don’t use deprecated or made-up attributes (e.g. “background” attribute doesn’t exist) and of course use CSS to set widths, etc. Obviously this is still not semantic and divs are better for layout, but it proves the point.
Rob
August 14th, 2008 5:12 pmTables work … it’s CSS that sucks!
When I can create a grid layout using CSS that works in all modern browsers, doesn’t require weird non-semantic markup and strange CSS hacks … then and only then will I stop using tables for my layout.
I’m not an anti-semantic, just a pragmatist.
Thomas
August 14th, 2008 6:41 pmVery usefull. Just had to use a table myself, so good to get some examples to follow.
Yudi
August 14th, 2008 7:47 pmThank u very much… very useful for my website…
emp
August 14th, 2008 11:24 pmVery nice.
I disagree with using backgrounds in tables, but the minimalist designs are very, very nice.
Thank you.
::emp::
casper
August 14th, 2008 11:59 pmgreat article. used the Horizontal Zebra for one of my projects.
give him the MB Air allready!!
jordan
August 15th, 2008 12:02 am@jacksonhyde
I believe I wasn’t talking about tables for layout, I was talking about creating valid tables for displaying tabular data. Which was also the point Henry Hoffman was making. I myself haven’t used tables for layout purposes for years, but I have had clients which require a form of displaying tabular information on a CSS layout and screenreaders cope with tables a lot better.
Toni Trivković
August 15th, 2008 12:51 amVery nice and useful article. Thanks on the source code ! ;)
Craig Farrall
August 15th, 2008 12:57 amI thought I knew loads about tables, not that I use them often, but alot of this here is very informative and useful, and could well come in handy.
Stefan
August 15th, 2008 1:38 amBei mir klappt der RollOver nicht mit IE6. Gibt’s da einen Workaround? Danke und vielen Dank auch fĂĽr den Artikel! :o)
dogday
August 15th, 2008 2:46 amAre you sure the last table is a Top one?
Arnar
August 15th, 2008 5:57 amIt’s not that tables suck, it’s inproper use of tables that sucks.
Manuel
August 15th, 2008 6:48 amNice article!
Rafael de Paula
August 15th, 2008 7:13 amVery cool! But, not working to IE6. There is a way of that works without having to use JavaScript?
FortyPoundHead
August 15th, 2008 10:56 amThank you, Ben! Tables do have their use in the display of tabular data.
“Professional” web designers have made such a racket about not using tables for layout, and all the noobs can hear is “No tables! No tables!” Take it easy, noobs. Tables work fine. Just don’t use them to build your whole site layout!
Aida
August 15th, 2008 12:04 pmAs someone who read a few books on html and css just out of the desire to learn something new, it’s hilariously funny to me that people who are supposed to be “professional” designers have no grasp what tables are used for.
I’m a teacher, and if I wanted to make a web page to present students’ grades I would use a table with their names and grades, not unordered lists.
Tables have their place in web design, they just need to be used for their intended purpose. I can’t believe a n00b like me knows this, and these guys don’t!
This is by far the best topic so far and it gets my vote. Some of these tables were really quite lovely, and the author presented a difficult topic in an understandable way.
mshalabi
August 15th, 2008 11:32 pmtabular data must be shown in tables.. not tableless…
Sander D.
August 16th, 2008 4:56 amI think this entry stretches the rules of the contest even further. A really nice article nonetheless, but 1200 characters of the discussion articles can’t start to compete with an extensive article as this one. It says “10 list items with a brief description (usually 1-2 sentences)” in the contest description/rules …
Dr John
August 16th, 2008 1:28 pmExcellent examples of how to style tables. What a pity some idiots do not realise that the semantically correct way to present tables of data is in a table!
mike
August 16th, 2008 5:37 pmI agree with i don’t remember who : there are bad examples, the ones whith movies datas whish should be coded using unordered lists.
Also, i think some experiments with a few JQuery plugins for gradients and rounded corners would have be cool, giving a taste of what will be possible when CSS3 will be well rendered by all the major browsers.
Anyway, it’s a very good article.
Kate
August 17th, 2008 12:13 pmAMAZING! Simply amazing!!! These tables just blew my mind and are very useful on top of that! More of this good stuff! :D
R.Christie
August 17th, 2008 6:18 pmWow, thanks for all the feedbacks and critiques! I have been away until now so I wasn’t able to keep up with the comments, but I guess it’s better late than never.
First, I apologize for the bad grammar. I am not a native speaker
of English – I usually have no problems discerning English in my class, but I am now considering taking courses in writing -
and buying a word processor with a decent spell checker. I WILL have my future articles proofread by an expert by the way.
@add
Thanks for that little JS trick. Fixes tr:hover in IE6 completely. Using Dean Edwards’ IE7 script is also advisable, and we don’t need to worry about people turning off Javascript in IE. Turning off JS in IE is a little complex, usually only the tech-savvy users can do this – and I think the majority (if not all) tech savvy windows users uses a more advanced browser.
@Stefan and @Rafael de Paula
Are you asking for a workaround for IE6 tr:hover? See above.
@Julien
I understand it’s ugly, and it invalidates your CSS ;p. But the selector points only to IE6 and below, which is the primary target because IE7 gets transprent PNGs allright. I always use conditional comments in
my work – which points to all versions of IE, I later apply the hack inside my IE-only-stylesheet. But of course it’s a matter of preference.
@Jimmer
Didn’t think of it that way, I have not tested my designs on various computers, so I never knew that using 1px backgrounds is prone to hardware problems. Thanks for sharing! Somebody please
add editorial notes on the article…
@Bob and @Jackson Hyde and @KangarooDeziner
Again, thank you for sharing your tricks. I hope CSS3 gets implemented quicker though. Advanced selectors and multiple background images are what all web developers been dying for.
@Carl Youngblood
Yes, you are absolutely correct. Thanks for fixing.
@Jeremy Brown
That’s why we’re all waiting for CSS3!
@JL and @mikemike and @mike
It’s a good point, and I might be wrong here, but I think when you are displaying a group of data that are meant to be comparable with one another – where each columns are separate entities but also meant to be read in relation to one another, the better way to do it is by tables. Maybe it’s a matter of preference, but IMO it would be very hard to try to style the above movie tables using just unordered lists because each column is not meant to be separate with one another as lists. They all need to be contained in a single container.
Again, I might be going to the wrong direction – but if it’s about semantics, the columns (or lists – if you prefer to call it that way) unite to represent one topic (movies I rated) – they are meant to be read together. Would it be easier to discern the data if they were styled in lists?
Anthony
August 17th, 2008 6:58 pmYes, Tables. Tables are still the best mark-up for tabular data such as invoices or tariffs or price comparisons.
Jackson Hyde
August 17th, 2008 11:27 pm@jordan
ah, a misunderstanding then. I’m all for using tables in the right context, just not for layout. I guess I was preaching to the converted. :)
Amphelice Brook
August 18th, 2008 3:07 amIt’s funny how many comments attack the idea of using tables for any purpose whatsoever, even if it’s for the supposedly approved usage of presenting “tabular data”. What does that even mean, anyway? Isn’t it all data? And if it’s in a table, doesn’t that make it tabular? How is a table not about layout? Why is “table” a dirty word but “grid” the next big thing? Before you bite my head off, let me just say that I use and enjoy YUI grids. I’m just beyond tired of this bizarre, supposed dichotomy.
Josh
August 18th, 2008 7:40 amTables are gay…anyone who is a web developer runs into gayness with tables at some point.
Once again…
tables = gay
Other than that great article…haha
Josh
Steve P
August 18th, 2008 1:12 pmSigh.
Flickr, Google et al use tables for layout, because they’re pragmatic about coding stuff. Who cares?
Toan
August 19th, 2008 10:05 amit’s because of articles like this one that i love smashing magazine
Nicole
August 19th, 2008 2:47 pmThanks for the nice article. It so happened that some days ago, I presented 30 CSS table styles on my blog: http://www.younic.de/styling-fur-html-tabellen-30-kostenlose-css-stylesheets
If you like this article, maybe you’re interested in additional styles.
Cheers, nicole
Matthew Dippel
August 19th, 2008 3:57 pmWell written (unlike my comment to follow . . .)
I’m getting annoyed with this whole movement *away* from tables in places where *only* a table makes sense. With later browsers, we have access to better methods for formatting a page’s general layout and using a table to do so is evil. I’ve had to deal with nested upon nested tables used strictly for layout, so I understand why the table tag is looking about as good as the frame tag.
That said, table makes tables. div/span et al are great for formatting (ul/li is starting to get evil though).
Failing to use the table tag when you actually have table data means you’ve failed to supply the browser with a hint of what is coming. It’s fine when every browser is a desktop browser of a reasonable resolution. Mobile browsers, however, may choose to format the data differently in order to optimize it for a small screen. If you pass in your creatively formatted table using the latest divs and spans and uls and li blocks, you’ll end up displaying that data in a very awkward way.
You’ll also cut out Excel importing (and any other method for grabbing “web data” until microformats are widely in use). I know … importing web data to excel can be evil too … but it’s common for enterprises and the “table” blocks are easy to parse purely *data* from.
To the author(s), I bookmarked after reading your IBM/Apple/others Q1/Q2/Q3/Q4:
“The above data were fictional and made up, please do not sue me”
… it really is the little things.
–
Matt
Romit Gadhiya
August 20th, 2008 1:38 amDude!
Thanks for the article.
adam
August 20th, 2008 3:33 ami wish so called designers really new about web. i use div’s span’s a lot but there are many cases you can not replace tables because you make coding longer, harder and broken for different browsers. what is the gain?? nothing but headache. please guys learn the differences between these concepts. everybody loves coding with css but that doesn’t mean you have to remove table syntax from your design. use them a lot so you can make more elegant designs ;)
Ramnath
August 20th, 2008 4:39 amGud. Article. Hey designers dont think table is F****** one and its not a SIN. You can use in specific place, or where ever u need.
MikeWhoBikes
August 20th, 2008 1:36 pmCongrats on winning the guest author contest! This really was a great article: useful, well-written, and inspiring. Keep up the great work.
chris
August 20th, 2008 5:02 pmReading some of these comments just has to make you laugh.
‘F*** tables’. Are you pretending to know what you’re talking about because you read in on Digg 2 years ago. Tables should be your only option when looking to display tabular data.
Rakesh.S
August 21st, 2008 12:17 amSuperb article. My idea about CSS table-less design has taken new dimention :-D
Thanks for the post.
Francesco
August 21st, 2008 1:04 amvery fantastic tables :)
thank you for post!
Hinduismnet.com
August 21st, 2008 1:14 amIt is a pity that there are lot of people here who feels tables suck, this is plain stupidity. Tables need to be used for tabular data!
aardvarked
August 21st, 2008 2:25 amIt’s a shame so many so called web designers are totally ignorant to what tables should be used for.
This article displays their purpose perfectly, anyone saying tables should not have been used for any of the examples is talking absolute nonsense and has been reading too many “CSS vs. Tables” articles and totally missed the point.
Great article
Kyle Jacobson
August 21st, 2008 1:30 pmPeter-Paul Koch’s tables over at quirksmode are terrific. Really worth checking out!
Thomas
August 23rd, 2008 2:23 amGreat Article, Congrats for the win :)
giat
August 23rd, 2008 6:16 amcongratulation ya!!!
funfun
August 23rd, 2008 9:10 am(: cool
Babatunde Adeyemi
August 24th, 2008 7:10 pmNice piece
Parker
August 25th, 2008 11:47 amTables for tabular data are ok, but still they have to be 100% accesible. Using images in cells just to make round corners is nice but not truly accesible, sorry.
Hieu
August 26th, 2008 7:12 pmI really like this detailed article. It gives me more insight about how to style up tables and couple of useful/accessible mark-ups. Thank you for the great post.
David Boyd
August 27th, 2008 10:55 pmThanks for the great post…. I will be definitely using Table Number 9 on one of my site. Very handy.
erick
August 28th, 2008 8:41 pmcongratulation ricky :) Good Job :D
ay
August 31st, 2008 4:27 amIt’s complately true. :)
James
September 1st, 2008 9:40 amHm, nice article – reminds me of the one Veerle Duoh did years ago.
I’d say that semantically the highlighted column in example no.6 should probably be marked up as simple th’s with scope=”row” rather than using a colgroup and col elements – Incidentally, that’s the kind of data table I find myself using most often in my corporate web job.
gareth
September 2nd, 2008 2:24 amTables for data, forms (you know, lists of data and data entry) divs for page styling and laying out information.
No matter how much you love css and divs (and i do) there comes a time when tables are appropriate.
mrgtb
September 4th, 2008 3:35 pmGood use of using CSS in Strict
gaurav
September 27th, 2008 12:38 amjus trying!!!
nice tables css
Webdesign Internet Marketing
October 1st, 2008 10:59 amThanks so much. Great piece of styling.
Carou
October 6th, 2008 10:27 amThe hover effect doesn’t work in IE 6
Eddie
October 16th, 2008 5:59 pmStick a table up your bum bum
Mario Koerbler
October 17th, 2008 12:54 pmThank you for this website!
Best regards from Austria,
Sidimar
October 22nd, 2008 2:24 amFantástico…
Parabéns!!
pete
October 26th, 2008 9:37 amFor those who say ‘tables suck’. Tables shouldn’t be used for designing page layout. Mainly because of disabled people (screen readers read table cells from left to right and then skip to the next row, so you can imagine screen reader reading all the design stuff). But for tabular data we should use tables!!!
kenny
October 31st, 2008 2:17 pmLOVE THIS. thank you.
You could make the “source package” link much more prominent. I spent a lot of time trying to “view source” and re-create the right CSS before I saw that link…but then it was a breeze!
jaime
November 5th, 2008 1:45 pmnice code, txs!!
Wayne Whitty
November 11th, 2008 5:17 amI can say, without a doubt, that I absolutely love this website. Thanks for sharing the CSS! Other websites would have just shown a screenshot and left it at that; without even leaving behind the stylesheets!
Irfan
November 12th, 2008 2:17 amGood Article!
I tried to download the source but it asks for user name and password.
Can any one help?
Doug
November 20th, 2008 10:01 amGood article. I’m amazed at how people hate tables. It shows lack of experience. Back in the day, it is all we had. For the dynamically generated sites I create (in Perl which I’ll probably get bagged on for), tables are a quick and efficient way to generate pages. No WYSIWYG editors are needed. Just good old hand coding. CSS is primarily used for style not positioning.
In the end, website visitors don’t care what methods are used to display the page. As long as it works and looks good. Web developers should use all the methods at hand to develop efficiently so they can make a dime.
leo
November 24th, 2008 2:59 amey dude you talk about 100% css table, but you still using tables:
css 100% = no tables :)
coldcoffeebreak
November 24th, 2008 8:37 pmfor those who said that table is suck, my question is can you do a tabular data with 50 columns & 300 rows using divs?
slee
December 1st, 2008 4:47 pmjust wanted to say thanks as this helped me with some ideas for a table i was working on late into the evening
satyanarayana
December 1st, 2008 8:57 pmi have to learn css styles i think your site i have to use to me thanks good
Malte Nielson
December 3rd, 2008 6:11 amGreat article.
Compa
December 3rd, 2008 9:38 amExcellent great job. Very useful. Thanks
anushka
December 4th, 2008 7:18 amthanks dude
nice work
Kudaravalli's
December 4th, 2008 10:50 pmWOW nice
Dave
December 4th, 2008 11:11 pmCool. thanks for this.
Ben
December 11th, 2008 4:55 amNIce one..as Said, tables are for tabular data so don’t say “F*** Tables”
mehmet murat huyut
December 12th, 2008 7:47 amThank s good for me…
Furqonk
December 16th, 2008 1:00 amThanks for table css, i will use it for my internal application.
It’s really hard to create such as great css table when your time is running out. ..
God Bless U
DMuns
December 17th, 2008 1:39 amWow…I don’t get all the flaming of tables on here, even for layout purposes. I have had great success using a combination of tables and CSS for my site layouts, and they work without fail cross-browser almost 98% of the time. (Occasionally I run across some ticks, but nothing that can’t be quickly worked out.) I agree with the comments that “Doug” gave a few comments above this one.
I think all the CSS purists out there are missing the boat: CSS is a means for styling and visual appeal. You still need elements of HTML no matter what. It does not make you cooler than your neighbor to blindly state that “tables suck”. They can be very useful for all kinds of things, above and beyond just tabular data.
David Bloomfield
December 23rd, 2008 6:41 amGreat article
Yes some of the table examples here arent tabular data and could be better displayed in a list but people saying “crap”, “tables suck”, etc show they have little understanding of semantic (X)HTML.
When tables are used for their proper purpose they are perfectly accessible and you prove they can look great.
Keep up the good work Smahing Magazine!
Pixelate Webdesign
January 2nd, 2009 5:34 amThank you! This saves a lot of work! And I agree use tables where tables are meant for
Fark This World
January 12th, 2009 1:42 amThanks for this. Helps me a lot dude…And to all the table hater’s, suck these nuts….
Vincent lauv
January 22nd, 2009 10:49 pmThanks you it is very good idea to use css table
I currenty using at my site at Cambodia Tourism Website
Thanks
Michiel
January 30th, 2009 6:10 pmI love the way there are more table-basher-bashers than table-bashers XD
I think that it’s lcear that tables are a no-no for webdesign and a yes-yes for tabular information. How about we stop telling people this?
Jamiel Sharief
February 2nd, 2009 3:31 amThank you for putting this together, its just what I have been looking for.
Kris C
February 3rd, 2009 11:57 amAs a user experience designer who loves the look of free-floating text with white space as dividers, I really appreciate this article and the time it took to put all these samples together. Sorry the author has to deal with so many ridiculous comments by non software-designers who fail to grasp what the article is about, but I love it. I will be able to point to my developers and say “Make it look like this, please!” Great variation in examples too – very nice. I’m sure a lot of usability and software design folks found this helpful whether they waded through the multitude of comments to say so or not. :-)
Pieter
February 7th, 2009 7:33 amTo all who say tables are bad, they’re not.
Tables are bad if they’re used for layout.
If you have to show your visitors a large amount of data, numbers, whatever, you can show them in tables. That’s what they are made for.
Good article.
Pieter
Andre Morgan
February 12th, 2009 7:06 amAhhh tables……sigh…what can I say….they really do suck for building layouts but I must say that they have their time and place. They actually still work well (and dare I say maybe better) for presenting tabular information such as in the examples above.
….But don’t get the wrong idea, I still hate working with tables :-P.
mikeymouk
February 18th, 2009 7:31 amthanks for sharing this. May everyone feel happy with whatever they use as long as it fulfills their purpose. There is no competition on knowledge on the internet, and even less reasons to manifest its tensions. long life to free sharing !~
tanya
February 19th, 2009 3:14 amI love the css style for table, but IE6 is such a pain.
ecoy
February 19th, 2009 9:47 pmYikes, it’s really annoying when people post just for the sake of commenting. Someone said about youtube-like comments, yeah i read a lot of them here, (wish i could filter these noobers out) Imagine presenting a 30 column data with divs, what do you get ? Divititis. Present these data in tables, then you’re called a sucker! And and, to all MySql programmers, “tablesuckers” said that you display your data in divs, HAHAHA err. sometimes purists are close-minded people just the way some people define rock as noise and not music. :)
Frank
February 27th, 2009 5:54 amDoes somebody know any great tables in tables design?
And for al the “tables suck people” good luck with your span/div/dd/dt “tables”, they will suck for sure :D.
Anonymous
February 27th, 2009 10:49 pmThere’s a reason why tabeless works and tables are inflexible. It’s a stupid argument to say that you’re going to make a site rigid rather than spend more time making it extensible.
Today, that’s just unacceptable.
amjed
March 8th, 2009 11:23 pmAwesome article Christie, every web developer gotta have a copy of this page ..
JW
March 9th, 2009 3:24 amExcellent – just what I was looking for. A clear and concise explanation of how to present tables. It’s dismaying to have to read through the ‘noise’ of the CSS kiddies though, who haven’t discovered tabular data yet, but have just heard ‘tables are bad’.
Tables rule for tabular data. When the kiddies move on from just posting pictures of their game snapshots, and encounter real world data, they might realise that! :-)
Many thanks for the article.
website design
March 30th, 2009 11:29 pmI like this article,it described the css and table in details,I like it,I will study it carefully.
Djoh
March 31st, 2009 3:37 amThanks a lot
chonghwi
March 31st, 2009 9:13 pmwow.. bravo.. thanks for the effort..
Difre
April 2nd, 2009 1:15 amThank you so much for the source package, save a lot of time.
Nice work,
Much appriciated
Erik
April 2nd, 2009 2:00 amIn some cases, I think you need to use the border-collapse property to get rid of the gaps between columns. As stated in the article, be careful.
BOGAD
April 21st, 2009 5:18 amGood Job..^^
G B U
mgyaykhae
May 6th, 2009 11:57 ammany thanks !
Sergio Rivas
May 20th, 2009 9:20 pmWow, I thank you for teaching me in a practical way.
One question, how do you justify a round image when is only one column? I have not been able to divide 2 images in the same square, I have to do a table in that square. Any help, please?
Developer
May 21st, 2009 8:03 pmWow!!!
Excellent….
dellvostro
May 26th, 2009 7:57 amCan these tables be used multiple times on same page? I have one table working just fine. But if I try to copy and paste the table into another area of same page, the formatting doesnt apply to second table? If I copy a totally different table style, it appears fine. strange. ???
serverman
June 13th, 2009 1:28 amzip file won’t open. Kindly replace source code. Nice article though. Thanks.
JR Chew
June 14th, 2009 9:14 pmTables aren’t bad when you need to display tabular data… Using tables for page structure and layout is what is bad.
div
June 15th, 2009 5:03 amvery useful info.
Tony
June 24th, 2009 1:12 pmJust wanna say to all you table haters: “Back off!” Tables suck for layouts, but for displaying data in table format they are exactly what you should use!
Toni McConnel
June 28th, 2009 11:28 amThank you for this detailed article that took a LOT of time to create. Sorry you have to wade thru so many ignorant mean-spirited responses. Most of us DO appreciate your efforts.
hohoho
July 1st, 2009 7:56 amEnough with the table cries. Don’t like them, don’t use them.
They’re so “evil” that Google is full of tables. Ever looked at their source code? Why do you think Google uses tables in their results pages and search forms? Cause they’re accesible and will work on ANY browser. freaks of nature…
Chris K.
July 2nd, 2009 12:05 amvery very nice ! Thanks a lot guys !
Paul
July 4th, 2009 9:36 pmWhile tables may make it easy initially it can be a maintnance issue later on.
Doing css for anything but tabular data is not exactly intelligent.
However it can and should be ok for proper tabular data.
Doing it another way is foolish, especially in light of the stuff I have seen done where we feed a website with huge data feeds that are in table list form.
Ie; huge mainframe push ..doing it any other way than a table would be pretty stupid here.
In the above we are talking of about millions of cells. Very much like a spreadsheet view.
Claudia
July 8th, 2009 6:26 amReally an evergreen post, thanks!
Nick
July 13th, 2009 5:32 pmYou amatures, if you’ve ever worked in web design for any ecommerce company you’d know most server codes have to utilize within TABLES. Never using tables is fine for your personal website, but even Google uses tables… heavily. Sure, I know tables have a bad rap since a lot of people use them over CSS layouts but Tables are not going anywhere anytime soon.
Ben
January 8th, 2010 11:58 amNick, seriously? You don’t know how to use CSS to create tables without using the DEPRECEATED, OBSOLETE, NOT W3C compliant HTML?
LOL…. RTFM.
http://www.w3schools.com/css/pr_class_display.asp
FAIL
Seth
January 18th, 2010 2:48 pm@Ben: True, but with inline technic there is flaw if u have more columns and u want them to strech dynamicly. Lets say you have 3×3 matrix. And u change size by CSS or with bigger name/data in one cell (selected cell is located in second row, second column), result is messy table, because second row is pushed to right.
Take a break. Enjoy in life.
Dr
May 17th, 2010 11:45 pm@Ben: Are you 10 ?