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)





SohoInteractive
July 19th, 2009 5:07 pmGreat collection
Thanks you
F.
George Bonev
February 24th, 2011 5:15 am“About the author
R.Christie is studying information systems at college. He viciously juggles activities from college, web design, programming, church, to sport activities. ”
All seems fine except the church thing. Why brainwashing yourself when you have talent ?
Heraldmonkey
April 28th, 2011 12:23 amAll seems fine except the chip on your shoulder thing
Ceekays
July 27th, 2011 9:59 pm@George Bonev:
Yes, the church is good. It brainwashes all the stupid and inhuman stuff that you consume all day everyday. All in all, Christ saves! Bravo R.Christie for not being ashamed of the Gospel!!!
luas
May 12th, 2011 1:20 amhi, plz help me im trying to create page that will upload and it must have processing bar
David J. Heinrich
July 31st, 2009 5:18 pmRegarding the issue with vertical tables being inappropriate, that would seem to be right. The reason is because of the way screen-readers interpret them; how they are supposed to be interpreted by browsers. A screen reader will read a table row by row. Hence, data in rows should have relation to each other. The data in table #2 has no relation to each other (Scary Movie, Indiana Jones, The Punisher, Wall-E). This is because the first column isn’t a series of “column headers”.
I think that the post saying that the proper way to display that would be as headings and unordered lists would be correct. Part of the other issue here is that there’s no reason why he lists of movies under a certain category has to be of the same length.
As for how to get the side-by-side layout, you could abandon that and leave it as sequential layout (one beneath the other). Or you could use CSS floats to try that (but then you’d have to use the hacks to make sure they line up). If you’re fine with letting older browsers see it sequentially, you could use the new CSS tables layout method. This is a simple way to get a tables-like layout with just CSS; but it will only work on IE8, FF3, and other newer browsers.
A sloppy hack that would still be better than expressing it as pure tabular data would be to nest headings and unordered lists inside of table data in a simple table with one row.
government subcontractor
August 19th, 2009 8:27 amMost of my contracts is converting old code to ASP.Net. The government has a lot of data and most apps are for the display and transfer of data. Very large databases are now using MS SQL and table are a large part of the UI. CSS is cool but not a cure all. Thanks for showing the difference in styles. it is what i want to know. Great job!
Thanks
DJ Dude
September 14th, 2009 12:17 amnice article. Are css tables useful? I guess it’s more to do with if it’s properly used such as in tabular data vs layout div tags.
Jack
October 10th, 2009 3:52 amAm I the only one not seeing any of the examples in the article? I tried it in firefox 3 and IE 8
Juan
June 7th, 2011 12:19 pmDownload Google Chrome ASAP.
Mackenzie
November 12th, 2012 3:10 pmI’m looking using Chrome, and 5 and 6 aren’t showing anything special.
jimmyh
June 21st, 2011 1:09 pmI guess you are :D
Matt
October 10th, 2009 5:50 amThe examples all look the same to me (firefox 3, ubuntu). I assume someone removed the appropriate lines from the CSS file…. :)
Si
October 11th, 2009 4:06 pmcan you please fix the css on this article please? Thanks!
Sam
October 12th, 2009 9:10 pmYeah table design not showing up. Please fix. Need some inspiration.
Sven Lennartz
October 12th, 2009 11:37 pmSorry folks. Vitaly just fixed it.
Maggie
March 1st, 2012 10:33 amThanks for fixing it I keep coming back to this article everytime I need to style any tables in my projects <3
tonier
October 13th, 2009 8:51 pmevery tag with html have their own reason, and if you want to show data, you need to use table! Don’t use div with flow etc …
Mike
October 15th, 2009 4:33 pmtr:hover does not work for IE but you can make use of className property example:
CSS
.trover{
backgroud : #99BCBF;
}
.trout{
backgroud : none;
}
—————————————————————————————————
HTML
using onmouseover and onmouseout you call the className depending if mouse is ove or out
inside tr tag you put
initializing with class = trout
onmouseover = className=trover
onmouseout = className = trout
——————————————————————————————————-
This way you get te effect of tr :hover if your table is being seen usig IE. Hoper this comment is useful.
Ben Lacey
May 25th, 2011 12:29 amSomething’s fishy about that CSS …. (.trout)
Thanks for the code snippet, will come in handy, sorry for the bad joke :P
siiniqi
October 20th, 2009 12:46 amvery good article keep it up.
Nathan
October 22nd, 2009 2:51 pmWhen people refer to “Using Tables Is Bad!” what is meant by that is the actual use of tables to layout and structure the websites data areas. This used to be ever so popular in the early days of the web. Using a table inline with the rest of your content is very acceptable and sometimes is the best way to display a group / collection / sampling of data just like the examples used in this article.
Robin
October 23rd, 2009 11:56 amI see alot of comments like “tables suck” and “**** tables”. To me it sounds like you peolple who wrote these comments dont know why, you just think its a cool thing to write.
I have to say that though tables are most often a bad idea (like when people use them for entire layouts and such), there are times when they are very useful, like in the examples above, to use floats in such simple structures is simply overkill.
To the author of this post I say bravo… I will probably use these alot.
Visit my website by clicking on this link
Usman Arshad
October 25th, 2009 10:04 amvery great article thanks for share, it help me a lot specially its “valid xhtml 1.0 strict” markup. usually i play with div even tabular data. but after now i am going to work on table for tabular data, thanks again for the nice post :-)
klickjobs
October 27th, 2009 2:13 amHi there!
I love this list ….excellent!! Thank you so much!
I have a question: Is there any possibillity to “sort” one of these lists?
Hope someone can help me put :)
greetings from germany
klickjobs
x_maras
October 27th, 2009 5:32 pmThese are amazing!!!!
Thank you!
killer_mentat
October 28th, 2009 3:43 pmif it is a table you require, then it should be a table that you get.
nice tables.
Chris Perabo
November 10th, 2009 4:50 amI did two tables that I think are worth sharing (cause I’m proud of ‘em):
http://www.caplinq.com/specialty_tapes/polyimide_kapton_tapes.html
- Notice the alpha-image bottom right, and interchanging rows
http://www.caplinq.com/linqstat_vcf_s-series_linqstat_volume_conductive_film.html#
- A price table – looking sharp and clean.
Quique
November 13th, 2009 3:31 amgood job!!!!!!!!!!!!!!!!!!!!
thanks for all
bob
November 23rd, 2009 1:00 pmOf all the designs, I think the zebra tables are most appealing, particularly when the contrast is just high enough for a wide variety of users to differentiate between rows. It improves the readability of the table.
shaun
December 7th, 2009 3:01 pmI’m wondering how to create a multi tabbed html table. The reason being is because I want to have 4 tables displayed on a single page. But only show one table at a time with an option for the user to switch from one table to another using tabs. I found an example of a website using this table at http://www.hertsbaseball.com I’m not to sure how to achieve this but I think it will probably involve jquery
thanks
Allen
February 3rd, 2010 9:36 amGoogle Jquery tabs.
Matt
December 10th, 2009 12:01 pmIs anyone else having trouble unzipping the source?
dakk
December 21st, 2009 9:04 am@Matt : I think you may have issue with the permissions of the files inside the zip, just do a chmod755 in the extracted directory ;)
Waseem Abbas
December 31st, 2009 12:26 amGreat stuff very help full.
Thanks
Ujang
January 4th, 2010 4:36 pmNice designs.
Thanks & happy new year!
Jacob
January 14th, 2010 3:43 amI recently used this in a project. Wow, it looks so professional. Thanks a mill.
Ek9ay
January 23rd, 2010 4:50 amNice!Nice!Nice!
deadwin
February 1st, 2010 2:25 amAwesome…style dude…thanx a lot…
dilip
February 15th, 2010 11:47 pmgood post….i will use this for my website
ZAky
February 25th, 2010 1:33 amBeautiful I’ll use it.
I most agree that tables is not the most attractive way to display data.
But, in every application there is a backoffice section which most of it rendered as tables and for the right reason I think.
Polly
February 25th, 2010 4:20 amFantastic article, thank you. Although, I can’t understand why people are commenting on the use of tables in layout, etc – this article is to do with display of tablature data – it’s nothing to do with laying out a website and the arguement of tables vs. CSS, etc.
I think people just need somewhere to vent. I must admit website design and development is damn stressful ;D but basically, loving the article, very useful, thank you. Good luck with your college work C: xx
Rach
February 25th, 2010 2:53 pmHey there, how do I implement this into my current style sheet?
Thanks
Darto KLoning
March 9th, 2010 8:29 amwow, great job.
Aravind M Potadar
March 10th, 2010 2:40 amVery useful…..Thanks a lot for sharing the source file. I had been searching for this. Grate collections!!!!
Abdul Aziz
March 18th, 2010 12:21 amVery helpful article indeed. Worth reading. Please Keep up the good job.
Abdul Aziz
March 18th, 2010 12:22 amVery helpful article indeed. Worth reading. Please keep up the good job .
sholeh
March 22nd, 2010 6:44 amnice tutorial, thank’s
Alif
March 26th, 2010 7:38 amGreat post!. Its indeed a Smashing article :).
Yogendra Ghorecha
March 31st, 2010 5:36 amGr8 tutorial, However provide more CSS to male it more concur.
- Yogi Ghorecha
e11world
March 31st, 2010 10:05 amThis is one of the most useful articles out there. Thank you so much!
Ajay B Mali
April 6th, 2010 1:09 amNice to see such articles………………..very helpful in table/grid designing !!!
Thanks !!
Karthik
April 11th, 2010 10:20 pmGood article .. Really helpful .
Keep it up
progres8
April 19th, 2010 4:25 amCan somebody tell me why hover dont work for me in ie8
http://cope.users.sbb.rs/proba.html
Jean-Francois Monfette
April 21st, 2010 10:49 amExactly what I was looking for. I think I don’t have to search google anymore to find web design advices. I just have to search through Smashing Magazine and I’m done !
Yaniv Y
April 25th, 2010 10:00 pmThanks! This post is very helpful for me.
Garren
April 27th, 2010 6:21 amYou know, one of the most important reasons that Tables are amazing, is for Emails. If you have a company that does newlsetters, etc, you’ll come to realize quickly that so many different email clients have different requirements, however, they ALL can read Tables perfectly. CSS’d and XTHML 1.0 validated of course.
malek
May 11th, 2010 3:36 amplease tell me, how to create a table width css
Michael
May 23rd, 2010 3:56 pmThis are some very good examples, however not for what I’d like to do…
I have table of a week-schedule, I’d like to be able to style every column individually and every day has to be a different color (odd and even). Unfortunately I have no idea on how to do that, as I am a bit new to css. Any help would be greatly appreciated!
This is a simplified version of the table:
Day;Block;Class;Teacher;Location
Monday;1;;;
______;2;;;
______;3;;;
______;4;Embedded Systems 1;Luc Fryant;D205
______;5;;;
Tuesday;1;;;
______;2;Digital Systems;Bart Eestermans;D205
______;3;Light & Sound;Marjan Maes;D209
______;4;CCNA 1;Caroline Vanderheyden;P108Z
______;5;Digital Systems Lab;Patrick Dielens;P306
Wednesday;1;Multimedia;Jan Janssen;P108Z
______;2;Networkdesign;Tony Binnemans;D011
______;3;Light & Sound;Marjan Maes;D211
______;4;CCNA 1;Caroline Vanderheyden;P108Z
______;5;Webdesign 1;Bart Portier;P108Z
Thursday;1;;;
______;2;Digitale Systems;Bart Eestermans;E119
______;3;CCNA 1;Caroline Vanderheyden;P108Z
______;4;Embedded Systems 1 Lab;? (Den ambetanterik);P306B
______;5;;;
Friday;1;Webdesign 1;Bart Portier;P108Z
______;2;;;
______;3;;;
______;4;;;
______;5;;;
mjap
June 3rd, 2010 4:10 amThanks, Very good article.
Deepak
June 16th, 2010 8:56 amAmazing articles, It helped me a lot. Thanks!!
Gareth Poole
June 18th, 2010 7:23 amThanks a lot, having some pretty hefty creative block this afternoon. That’s what Friday afternoons are for though? :-)
Aeron
June 26th, 2010 1:18 amNice Example of tables… :D
Moises Urrutia
July 9th, 2010 9:56 amtr:hover does not work since ie did not support :hover pseudo class on anything but the anchor tag. The way to get around this is by using javascript to add a class of “hover” to your tr when your mouse is over it. Then you just create a style for tr.hover.
Enver
July 15th, 2010 5:28 amGreat article… thanks a lot..
Andre
July 23rd, 2010 8:42 amYay tables!
Kimi Wei
July 26th, 2010 8:21 pmDude, you should rename this article. It doesn’t design any tables with CSS, it just styles the “look” of them. Once you use a table CSS design is shot down.
benjamin a. petersen
July 28th, 2010 4:36 amI love this article — I use the examples here as quick springboard for a table design all the time.
Beth Budwig
July 28th, 2010 2:11 pmI realize this comment is on a post from two years ago, but I was referred here from Dan Cederholm’s most recent book on markup, and I’m surprised no one has mentioned the “caption” element. It’s a tag I’ve often wished I could use with images, but its only home is inside a table at the very top: http://www.w3schools.com/TAGS/tag_caption.asp.
Also, to Kimi above — content and CSS typically dictate the design together. If you have tabular data, what’s the concern about using a table rather than a mess of divs or lis? I recommend Cederholm’s chapter on tables.
Anyways, nice post. :)
sadasd
August 31st, 2010 5:27 pmasdas nice
ronnie
September 1st, 2010 4:46 pmGreat tutorial. I need this to know more about table style. Thanks
bora
September 2nd, 2010 8:54 pmi like that perfect and i think use my web site
christ
September 3rd, 2010 1:57 amvery good! I like !
ks
September 13th, 2010 8:05 amTABLEs r ugly and the hardest to work with, DIVs r much better
Vincent
September 28th, 2010 1:00 amIt’s very useful to me. Thanks
denise
October 13th, 2010 8:46 amgreat article and very timely – thanks!
eirjaf
October 24th, 2010 9:31 pmPerfect !!!
angel
October 25th, 2010 3:14 amthank you. best sample
Osama
November 3rd, 2010 9:01 amJust excellent!
Adrian Garner
November 14th, 2010 5:26 pmIs there a reason you would apply the styles to IDs rather than classes?
I thought IDs were supposed to be unique. There could be multiple tables on one page using the same style, in which case you would have to use the same ID twice to make the tables look the same.
I suggest you change change #hoz-zebra to .hoz-zebra and to accordingly.
Thanks for the nice styles ;)
TenLeftFingers
July 13th, 2012 7:22 amYeah, this html fails in the validator (http://validator.w3.org/check). But changing them from ID’s to classes should sort it out. If
Gillian
April 2nd, 2013 5:29 pmReally sure about it ? Although most of the information provided is true as per my knowledge but I don’t agree fully. I think it should be more practical. I visited your website while searching for your topic and hope to see more good information on it. Do keep up the good work.
Vlada
November 23rd, 2010 1:55 pmExcellent article, I tried few tables, modify a little and use one of them for personal site :)
Arnold W.
November 25th, 2010 1:16 pmThanks! This is great!!!!
Abdul Wahab
November 29th, 2010 2:43 amreally nice and great….. Salute to your hardwork
srikanth portal
December 12th, 2010 9:52 pmNice designs..Thanks…
Sean Wong
December 13th, 2010 12:10 amit’s really good!!~useful for me, thanks!~upupup
ViRuS23
December 15th, 2010 7:52 pmNice CSS Designs !!!
Simple and Elegant to use, thanks for the info.
Eric Nguyen
December 20th, 2010 8:05 pmEver since I started doing programming and searching for knowledge on the Internet, I haven’t found so many articles as good as this one.
Thanks so much, R. Christie!
Eric
Martin
December 27th, 2010 12:12 pmVery usefull you helped styling my tables very quicky using this examples. Thanks a lot!
ThingsworkS
December 29th, 2010 3:24 amgreat tutorial…but More patterns and color combinations would be appreciated.
oluwaseun
December 29th, 2010 10:35 amGreat job dude. Saved me loads of DT (development time).
pols
January 28th, 2011 8:11 amThis is very awesome!!!! great tutorial.. keep posting a great tutorial.. Cheers!!! :)
JakeDaSnake
February 1st, 2011 6:46 amThese tables rock my world.
michelle
February 8th, 2011 5:57 amexcellent info ! must be more people like you that share info so valuable and helpfull.
Azeem Michael
February 14th, 2011 12:43 pmthanks for creating a downloadable source files — made things a lot easier
Pradeep
February 20th, 2011 8:31 pmGenius! Thanks!!
Mushal
February 24th, 2011 8:00 amHi guy, Thanks for the nice styles but I tried them with my cgi and they not working :(
any help???
Thanks
ChimericDream
February 26th, 2011 8:59 am@Mushal,
While I’m not the original poster, I can tell you that saying “it doesn’t work” will do absolutely nothing to get help. If you’re having problems, state what you have tried and exactly what is going wrong.
Here’s a great article on effectively reporting bugs: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html
That said, I have used these styles on several websites over the past couple years with no issues, and they obviously work here. So my guess is there is something going wrong in your implementation.
Sorry if this is coming across strong. I work as a developer as well, and it can get frustrating when the only feedback you get is “it’s broken, fix it!” with no further information.
Hope that helps.
Caylee
March 15th, 2011 6:34 pmCoool… You’re so helpfull..
Thank you so much to you ^-^
Mwamba simbao
March 16th, 2011 11:36 pmawesome just what i needed….
Mohit
March 17th, 2011 12:41 amIt is good. I was just wondering if it’s possible to create a custom Design for the table. (I’m using WP-Table Reloaded from WordPress).
Mohit Chopra
Sush
March 19th, 2011 11:27 pmThis is a great article. But i want to mention one important thing. Usually we display lot of stuffs in a table. That needs a scroll. Any best way to scroll the table content with the header column in tact. Becoz, I tried including a div with scroll inside tbody. Providing overflow attribute to tbody works in mozilla only. Does not work in IE. Any help would be appreciated.
Thank you
david dawson
March 25th, 2011 7:43 amSuper usefull thanks! I’m now implemented this on 2 of my websites… can’t say how happy I am with it!
Dinesh Balendran
March 27th, 2011 6:23 pmAwesome you are a champ!
Bahadur Asher
April 4th, 2011 1:05 amGreat article, it has helped me lot understanding tables and the icing on the cake was the source files, the explanation has simple to understand which made this article brilliant.
Thank You very much
P.S. wish someone could do the same with drop-down menus???
Jayalakshmi
April 5th, 2011 2:04 amThanks a Lot..It was very usefull to me… Thanks
osearth
April 26th, 2011 5:20 pmthanks for sharing
Scott Foubister
April 28th, 2011 2:30 pmThanks a lot, this was a great example to learn about tables styles.
Hasn
May 2nd, 2011 6:04 pmThanks a lot,
very nice work and helped me in styling my pages
Cheers
MrJuan
May 19th, 2011 11:29 amIs anybody else having issues in IE8? For some reason, the table headings (column titles) are shifted more to the right. You can see what I mean if you view this article in IE8.. I couldn’t isolate the problem in the CSS. Any ideas?
MrJuan
May 19th, 2011 12:37 pmI fixed it by removing the width in the main class and adding a padding-right to the th.
vee
May 30th, 2011 1:23 amI barely no idea with css and page design. You save my life indeed. Thank you for your kind of sharing things : )
kouysocheat
May 31st, 2011 6:37 pmit’s special for me,thanks
Nanang Gunawan
June 9th, 2011 6:30 pmperfect table..
thanks… very usefull….
nhoj
June 11th, 2011 7:16 pmsupah cool…
Pim Schaaf
June 13th, 2011 2:13 amVery nice! Thanks a lot!
I add:
cursor:pointer;
to the tr:hover td styles when I use the table rows as links.
Mike Combs
June 15th, 2011 8:48 amI think vertical tables are legitimate and useful when you want to compare a few items to each other. The key is that each row should compare a single type of item, but each cell can contain several items. In the example here, the second row has several titles of movies. It would be wrong to put each movie title in a row to itself; it’s okay to have a different number of movies in each cell.
If you wanted to add a third row, like top directors for the genre, for clarity you’d probably have to add a label column on the left. That would change the table back to a more traditional grid.
Jessica Nolhein
June 21st, 2011 12:51 pmHi there, nice to see you guy here – keep up the good work
assad
June 29th, 2011 8:36 pmAwesome post man… :)
Ashwin Hegde
July 7th, 2011 12:32 amGood Job Bro…
EddieRenz
July 12th, 2011 11:27 amOMW. This article and the downloadable set of files just saved me some serious hours of coding. I was going to do the table in CSS, but with 3 columns and 10 rows – the spacing and formatting was going to be a huge nightmare. This works flawlessly – except for the CSS Rule – Border-Collapse – which just needs to be modified to cellspacing=”0″ in the HTML instead of trying to make it work in the CSS. EXCELLENT article though, I had no ideas tables could be so awesome!
rajesh
July 18th, 2011 1:57 amnice tutorial:)
how to design table with fixed header with browser compatibility with pure css ?
rajesh
July 18th, 2011 2:05 amcan anyone plz help me
how to create a table with fixed header with browser compatibility ?
only in pure css with no javascript ? ):
Chris Quinn
August 5th, 2011 8:15 pmI love them, quick access to some great CSS Table styling. Thanks!
michael
August 7th, 2011 3:14 pmstill so useful til this day! great tutorial, thanks so much.
eli
August 16th, 2011 6:38 pmYou could use a style generator for the tables as well. Here is one of them http://gridstyler.com, can do more of the basic things easily but limited.
Matt
August 24th, 2011 2:18 amThis article was great, I used to struggle with table css but this really really helped.
Killer
September 7th, 2011 12:54 amVery valuable info….great tutorial..Thanks a lot man.
eg
September 7th, 2011 6:12 amHere is a tool which I use for simple table styling, mainly for data grid stuff. http://tablestyler.com
The techniques are a little more in depth. You might be able to use the two together.
Suyash Sumaroo
September 12th, 2011 10:13 pmReally nice work..will really help me to design tables quickly
Chad
September 19th, 2011 11:47 amI’m reading this article also it seems to be terrific! Nice way of writing and you’ve got explained some excellent points with this issue.
Paul
October 13th, 2011 4:01 amThanks for the artcile, esspecially the source file! I learned lots from this!
Thanks!
Maico
October 18th, 2011 3:35 amthanks a lot! keep with this good job
Varsha
October 20th, 2011 11:17 pmVery useful article .. thank you ..
Fasya
November 9th, 2011 9:49 pmit’s very beatutiful & useful…
how awesome it is..
erin
November 13th, 2011 9:32 pmit is really helpful also looking beautiful. thank you for your inspirational tutorial
Michael
November 20th, 2011 3:50 amThank you for this; it was very useful to see some great layouts and give to some worthwhile input upon how certain attributes affect the readability etc :)
Yogesh
December 5th, 2011 3:17 amThank u so much…..:)
John Doe
December 8th, 2011 12:05 pmI used one of those designs in my web programming exam, thanks man, i fucking hate designing shit :D
Fábio Rodrigues
December 12th, 2011 8:21 amYou can add rounded corner to an table without using photoshop. In most modern browsers (that is no ie6) use this css tag:
border-radius: npx;
where n is number of pixels of rounding. I normaly use 5px.
manan
December 14th, 2011 4:44 am.Table {
border: 1px solid #BBBBBB;
border-collapse: collapse;
padding: 5px;
}
apply this css for table
.Table td {
padding: 8px 12px;
}
.Table td td{
padding: 0;
}
.Table td .Table td{
padding: 0 5px;
border-right: 1px solid #BBBBBB;
height: 30px;
}
.Table .input {
border: 1px solid #BBBBBB;
background:#FFFFFF;
width: 215px;
height: 20px;
}
Clay
December 19th, 2011 9:20 amThanks for posting this. I’ve been looking for a lightweight table. I see you have a few examples that highlight rows, can you post one that highlights columns?
Keith Davis
January 22nd, 2012 5:41 amNot done any html / CSS for tables for ages – I’m a bit rusty.
Thanks for the tutorial and thanks for providing the source files.
Much appreciated.
Greg
January 26th, 2012 3:40 amI can’t choose “bad” in the quality poll.
Lucas
February 3rd, 2012 8:15 pmHey! Could you guys fix the CSS on this article, please? I’m using Google Chrome (in Ubuntu) and all the examples look the same! :(
JDev
February 7th, 2012 11:36 pmThe table’s css is not seen here…
deen05
February 25th, 2012 2:27 amThank you very much
over all are nice.
David Hitt
March 14th, 2012 4:36 pmThanks for the great post; I know you wrote it three years ago but it is still proving profoundly useful to me…
Svelta
March 15th, 2012 8:09 amSuch an amazing article! :D
Thanks a lot!
Kismat Konnection
April 19th, 2012 8:34 pmThanks R. Christie for “Top 10 Express CSS Table Designs”. Its really Very Helpful, Thanks once again.
Steve Smart
June 27th, 2012 1:46 pmGreat work, Sir. It helps me a lot… Thank you very much.
Adam
August 22nd, 2012 9:40 amJust what I was looking for. Many thanks!
Ruben B
September 4th, 2012 1:13 pmIt might be a bit late. But as I like being lazy, I see you want to add classes for certain effects.
In stead of the even/odd class, you could be using tr:nthchild(even) and tr:nthchild(odd).
The CSS2 standard also has :lastchild and firstchild pseudoclasses, which you can use for the rounded edges.
Or even better:
-moz-border-radius: 15px;
border-radius: 15px;
These round the borders without needing images. :-).
gristlegaga
November 6th, 2012 8:36 amgreat ,it help me so much .Keep do this
heavenin
November 7th, 2012 7:42 amGreat work! thank you very much for sharing!
Mackenzie
November 12th, 2012 3:09 pmI’m not seeing it on #5 & #6. There’s no column shading or anything.
Jose Luis Morales
November 26th, 2012 7:40 pmGreat, clean, minimalist, easy to integrate for my work proyects.
Great work! thank you very much for sharing!
From Venezuela.
Happy day.
arsita
December 7th, 2012 3:04 amWhy can’t i see the code of the #9 Table background?
is this: 1
* html table tbody td
2
{
3
4
/* IE CSS Filter Hack goes here*/
5
6
}
all there is to it? If so can someone give me the css style of all the table?
Thank you in advance.
Matthias Kohlhoff
January 25th, 2013 8:52 amThanks for this great collection! I searched for it …
mistazam
February 19th, 2013 12:07 amGreat! awesome! thanks :)
Rohir Naik
March 18th, 2013 5:17 amAwesome… Nice article for tables…
Dawid
April 2nd, 2013 3:52 amThank you for the nice tutorial… God bless you more!!!
Danison
April 2nd, 2013 4:15 amThank you very much for the excellent and professional work you did :)… God bless!!
Greg
April 6th, 2013 8:09 amOutstanding article. Great job and beautiful tables.
Paul
April 16th, 2013 12:25 pmOutstanding article!
Thanks so much for taking the time to write and share.
Mohammad
April 24th, 2013 11:17 amNice and easy, thanks