Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

By applying the yui3-table-striped class to a table element, it applies the striping to the odd rows #1

Merged
merged 1 commit into from about 1 year ago

2 participants

Kevin Isom Tilo
Kevin Isom
Kevnz commented March 30, 2013

The nth child selector allows for the table to be marked and not every row.
Excellent browser coverage http://caniuse.com/#feat=css-sel3
Explained here http://dev.opera.com/articles/view/zebra-striping-tables-with-css3/

Kevin Isom Added striped table and nth child selector
The nth child selector allows for the table to be marked and not every row.
Excellent browser coverage http://caniuse.com/#feat=css-sel3
42b0dd2
Tilo
Owner

Thanks! I'll merge this in, but I think it makes sense to keep the existing class names as well, for people who are targeting IE6 and 7.

Tilo tilomitra merged commit 575af91 into from March 30, 2013
Tilo tilomitra closed this March 30, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Mar 31, 2013
Kevin Isom Added striped table and nth child selector
The nth child selector allows for the table to be marked and not every row.
Excellent browser coverage http://caniuse.com/#feat=css-sel3
42b0dd2
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 4 additions and 0 deletions. Show diff stats Hide diff stats

  1. 4  css/tables.css
4  css/tables.css
@@ -55,6 +55,10 @@ striping:
55 55
     background-color: #f2f2f2;
56 56
 }
57 57
 
  58
+/* nth-child selector for modern browsers */
  59
+.yui3-table-striped tr:nth-child(2n-1) td {
  60
+    background-color: #f2f2f2;
  61
+}
58 62
 
59 63
 /* BORDERED TABLES */
60 64
 .yui3-table-bordered td {
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.