philihpAboutPGPLightning

CSS even/odd row selectors! Finally!

Philihp Busby,0 min read

IE9 has been released, and it finally includes the "nth-child" pseudo-selector in CSS! In the past, this has been done on a server side, or with javascript. Now we finally have simple CSS rules for rows in tables that highlight every even or odd row, and it works in every browser without any hacks.

tr:nth-child(odd) { background-color: #def; } tr:nth-child(even) { background-color: #fff; }

BrowserRelease Date
IE1April 16, 1995
IE2November 22, 1995
IE3August 13, 1996
IE4September 15, 1997
IE5March 18, 1999
IE6August 27, 2001
IE7October 18, 2006
IE8March 19, 2009
IE9March 14, 2011

GitHub · Bluesky · LinkedIn · Instagram · KeybaseRSS

Built from 8f0906ac CC BY 4.0 — with love from San Francisco.