I have submitted a table stylesheet to a new CSSZenGarden like site CSS Table Gallery. Their is nothing overly complicated about the style other than it uses some nifty CSS 2.1 selectors for standards compliant browsers (read: not Internet Explorer) to add an arrow next to the download links. In fact, let me outline the code I used:
tbody td a{
background: url(down_arrow.gif) no-repeat;
background-position: top left;
min-height: 20px;
padding-left: 20px;
float: left;
padding-right: 4px;
}
tbody tr th+td a{
background-image: none;
padding: inherit;
float: inherit;
}
/* Fake for IE, argh! Maybe IE 7 will resolve this. */
tbody td a{
_background: none;
_background-position: inherit;
_padding-left: 2px;
_float: inherit;
_padding-right: inherit;
}
The first rule adds the arrow to all links that are children of a regular table cell. This is a problem of course because we don’t want the download indicator next to the author links. Therefore we use the preceding sibling (+
) selector in the second rule to find the section that is the table header cell (TH
) and then remove the background image and download styling for that link. The third rule is a hack to get Internet Explorer to ignore the whole thing.
I like to style things in orange simply because my brother, Ed, likes orange 🙂 Yeah, I’m weird like that.
I used TopStyle Pro 3.12 to code this and Color Schemer Studio to grab complementary oranges.