Thread:Project:Support desk/Zebra Wikitable - Not Alternating Colors in Any Browser... Anyone else have this problem?/reply (2)

They have a bit of code in wikibits.js to get this effect. You can get a similar effect by putting the following in your MediaWiki:Common.js page:

// Tables with class=zebra $(document).ready(function { // the "className" includes all the classes so we must use re;  // CSS is case-sensitive anyway, so there is no point ignoring case:  var re = /\bzebra\b/,      t = document.getElementsByTagName("TABLE"),    n = t.length,    r, nr;  for (var i=0; i<n; i++) {    if ( re.test(t[i].className)) {      r = t[i].getElementsByTagName("TR");      nr = r.length;      for (var j=1; j < nr; j+=2) {        if (r[j].className) { r[j].className += " stripe";}        else r[j].className = "stripe";      }    }  } });

You'll also want to add a  class to your MediaWiki:Common.css page:

.stripe { background-color: red; }