
Have you ever used tables in your articles? These days most people haven’t.
HTML tables were used a lot a few years ago but nowadays most people have forgotten about them.
Maybe it is because designers used to have to design web sites by using tables in the early days. Since this was a very confusing way to style web sites it created a rather negative feeling towards using tables. No matter what the actual reason was, tables are still a great way to present content.
They make is so easy at presenting information that once you get the hang of it you never want to have to miss them again.
What Kind of Information Can Be Presented in Tables?
HTML tables can prove useful for several sorts of information. Of course there is information which does not make sense to present in a table but some content will simply look great when you use tables to display it. For example you could use tables for:
- comparison of all sorts of information, e.g. different web hosts
- lists (common to social media)
- time lines
For a working example; I used a table to present the different ways you can make money off a web site.
Basic HTML Table Knowledge
Before we can begin with creating a table, we need to have some basic knowledge for creating tables. The following are the common HTML tags used for tables.

I hope this helps you in understanding about what makes up a table. If you are still not sure then I suggest reading a more thorough HTML table guide.
Here is the standard HTML table layout:
<table border="0"> <tbody></tbody> <thead> <tr> <th>Headline</th> <th>Second Headline</th> </tr> </thead> <tbody> <tr> <td>First Row, First Column</td> <td>First Row, Second Column</td> </tr> <tr> <td>Second Row,First Column</td> <td>Second Row, Second Column</td> </tr> </tbody> <caption>This is the table caption</caption></table>
This code creates a new table with three rows and two columns. The first row contains the table header while the other two are just normal table rows.
You also have to know that there is a way through which you can span one cell across multiple columns. You can do this by using the <td colspan=”3″> property. In this case the column will span across three columns.
Because this default table (without any CSS) doesn’t look good, the next thing we need to do is to add some custom CSS code to completely change the look of the table.
How to Style Tables Nicely
In order to style your table you need to locate your default CSS stylesheet which is usually called style.css . At the bottom of the file, add this code for the table.
table { width:100%; border-collapse:collapse; line-height:1.6em; color:#3B485F; text-align:center; }
The CSS width tag is used in this case to make the table spread across the whole content section. Border-collapse is used to remove the default borders that are created when using tables. We have also increased the line height and changed the color of the text. Further, notice that the text is center-aligned.
table tr.odd { background:#FFEFEF; } table tr { background: #FCFFDF; border-bottom:1px solid #EFEFEF; }
tr.odd is used to style every odd row. To make these odd rows stand out we just change the background color. And to separate rows from previous ones we added a little border.
table td { padding:0.1em 0.2em; }
Now we have added some padding to the columns to make the content blend in well.
table th { padding:0.2em 1em; background: #AFCCFF; border-bottom: 1px solid #9F9F9F; color:#fff; }
We changed a lot in the table header to make it stand out from the rest of the content. We added more padding, a different background and border, and also set the text color to white.
table thead th { height:35px; background: url(tableheaderbackground.png) repeat-x; font-size:1.1em; }
We want the main table header to stand out most of all, so we apply some extra rules to it.
In this case we use a background image (a simple gradient, click the link to download it) that should be placed behind our table header column to make it look nice. The picture should be as high as the height we set, i.e. 35px. We also increase the font-size a little bit to make it standout from the rest of the table.
table caption { caption-side:bottom; font-size:0.9em; padding:8px 5px; color: #7F7777; }
The CSS property caption-side is used to define where the caption should be placed, in this case we want the caption below the table. Then we decreased the font-size a little bit, changed the color of the text and added some padding to set the caption apart from the rest of the table.
Here is what the table will look like using different content but the same CSS code:

If you do not want to use this format for every table, then go ahead and add a class to every table entry mentioned, for example table.list.
Ideas to Enhance Tables
One cool feature with CSS is that you can use the :hover method not only on links but on all sorts of HTML tags. For example you could add a td:hover to the CSS code to style columns differently when people hover over it.
Further if you want to make your table more exotic you could also change the cursor when someone moves over the table by using the CSS cursor property. Even though some people do it I would be very careful to not change the cursor into something completely unknown as it will confuse your visitors.
Conclusion
This article outlined the overall use of tables and what kind of information can be presented through them. I also hope it helped you in understanding tables better. You should play around with styling tables and maybe design your own cool table that especially matches the style of your web site.
Have you ever used a table in your post content? Or do you just not trust them at all anymore?
Custom Search
Heather (2 comments)21 May 09
What a great tutorial! I think that the tables were used so much for web design – back in the day – that we forgot that tables were originally intended for the purpose stated here.
I definitely think tables still serve their purpose – just not for web design.
Brian Cray (2 comments)21 May 09
Good post. People forget that there is semantic and usable value in tables. They’ve become such taboo
Brian Cray’s Latest Post: Branding for web professionals: An introduction
Alistair (2 comments)21 May 09
I think it’s important to specify that tables are a great way to present tabular content.
Saying that tables are a great way to present content opens the gate to the garden path that ends in table-based layouts.
Alistair’s Latest Post: Power up your Vote
Gianluca S. (6 comments)21 May 09
Right.
Tables are for tabular content. They’re not used much in blogs because writers tend to explain data without them but in some cases they are very useful. Another reason could be that most blog platforms don’t allow to post tables in wysiwyg
Gianluca S.’s Latest Post: Posting wonderful Flickr photos to your blog as customized drafts
Julius Kuhn-Regnier (5 comments)22 May 09
@Heather – I am glad you like the tutorial. Why do you think tables aren’t important for web design anymore?
@Brian – yeah that’s exactly the reason why I wanted to write a post like this, because people have just forgotten about tables even though they can be so useful.
@Alistair – do you really think that when people start to use tables we will again end up with web sites based on table layouts? I think people have noticed that it’s just too much of a hassle to use table-based layouts.
@Gianluca – good point, it is true that most blog platforms do not support tables or at least not in WYSIWYG. I still don’t think that you have to limit yourself to only presenting tabular content in tables only. There are lots of things you can do once you get the hang of using tables.
adis (9 comments)22 May 09
I’am a newbie so if i want to make table i just make it in excel, than print screen. Haha…so the table is just an image…
adis’s Latest Post: Secure Your Home Like Bank Security System
Aman@BullsBattleBears (11 comments)22 May 09
I have been trying to figure out how to make tables to post my stock trades in monthly summaries. Hopefully I can use some of these tips and make them…other wise, I will do what adis said above…print screen.
Aman@BullsBattleBears’s Latest Post: Another Downward Slide on Wall Street
Julius Kuhn-Regnier (5 comments)22 May 09
@adis – of course you can use Excel it just depends on how and where you want to use the information presented in tables. Using a picture of a table works fine but it has major drawbacks, for instance you can’t easily update the table. In order to do that you would have to take a new screenshot.
@Aman – are you posting these monthly summaries on your web site? If you are then it would probably be worth it to get used to using tables.
Julius Kuhn-Regnier’s Latest Post: WolframAlpha: A Successful Search Engine Approach?
Webdesign Meppel Drenthe (3 comments)22 May 09
Tables are great for representing tabular data, and that will always be. I don’t use tables for website layouts anymore. Used to in the early days but divs blablabla
Webdesign Meppel Drenthe’s Latest Post: Linkbuilding: de tijd van snel en makkelijk is voorbij
existdissolve (1 comments)24 May 09
Hey–
Good post. It is good to remind everyone from time to time what the purpose of tables actually is, and you do a good job in the post of explaining that.
The only thing I would add is that you should expand this topic, or do another post on the accessibility features available in tables. Tables are great for displaying tabular data, but there is some work involved to make them usable by assistive technologies.
Also, just from a person preference, I recommend left-aligning the text; centering is hard to read for a list of a variable length words
Julius Kuhn-Regnier (5 comments)24 May 09
@Webdesign Meppel – the point of the post is not to use tables for you web site layout, I hate this too. The point is that you can use tables to present content on your web page nicely.
@existdissolve – what do you mean by creating another post on the accessibility features available in tables?
And you are right, left-aligning text is usually better, but I realized that it looked kind of strange in the table’s header because there was a huge gap on the right side.
Poster Printing (1 comments)26 May 09
I can still remember before, we even had a whole course on how to design web sites using HTML tables. That was hard! But really very fulfilling
You really have to be meticulous with the codes because a single stoke could make the difference. But once you set something up successfully, it’s really gratifying. A labor of love, we used to say. This tutorial is wonderful, especially for beginners willing to try their hands at using HTML tables. Thanks so much!
Stacy Spear (1 comments)28 May 09
You have two tbody sections. Also, show the table before CSS is applied and after each change would make the article better. Still, a good refresher!
Bill Simcox (1 comments)30 May 09
There are so many problems with divs that it is hard to justify not using tables.
I’ve often mixed divs and tables.
I’ve even used tables to lay out navigation… and it works.
I try to use divs for everything these days, even forms, but oh the hassle!
David (16 comments)1 August 09
Thanks guys. This information helped me heaps. Glad I came across it.
Keith Davis (60 comments)1 August 09
Nothing wrong with tables.
All my first websites were set out using tables.
Once I started reading about divs and CSS… I stopped using them for all but tabular information.
Having said that, divs and floated layouts can lead to a few sleepless nights, especially if your client uses IE 6!!!! But there are lots of hacks out there.
Never got involved with styling tables… might start looking at styling after reading this article.
Pinson Digital (1 comments)8 September 09
Thanks for the great resource. I used tables a lot on my site as I am still learning how to design a website. Very challenging for a newbie but you post provided much needed information. The more I code, the more second nature it becomes and the more willing I am to try more “advanced” ideas. Thanks again.
Mike (9 comments)26 September 09
And here I thought tables had to look ugly. Thanks for the tools to make them look great.
modeller (1 comments)10 November 09
Thanks. this stuff doesnt work any more dudes..
can smebody suggest smething else…
Nettisivut (2 comments)11 January 10
Thanks! This was totally new for me! Every day I learn something new! =)
Furniture Lift (21 comments)27 February 10
Nice post, I really leaned a lot from here. Yeah, your right tables are helpful in presenting to visitors the different content of your site. Because of this tutorial I can now create one for my site.