[wp-hackers] best practices for plugin styles

Jeremy Clarke jer at simianuprising.com
Tue Feb 15 20:42:22 UTC 2011

One other thing that is often useful when styling tables is a .alt class on
every second row (preferably also with .odd and .even on rows for people who
prefer that semantic construction).

Unless you have borders on your table cells, having a background color on
every second row has a huge positive effect on readability of the data.
Pre-emptively giving theme authors the chance to add that kind of style will
make it easier for them if they find bordered tables don't' look good in
their themes (I rarely find bordered tables look good anywhere)

.alt and .odd/.even are a common paradigm in the wp-admin aready already so
many people are used to them.

Also: +1 to the advice the others already gave you. Having periods in CSS
classes is crazy because you use the period so much in the CSS syntax
itself. Make each tr/td have both a generic class and a specific ID with a
number (which might be useful, for example, to style only the first row a
special way without depending on :first-child).

Jeremy Clarke • jeremyclarke.org
Code and Design • globalvoicesonline.org

More information about the wp-hackers mailing list