//   SSS
//  S
//   SSS
//      S
//  SSSS  triped tables
// for original version see www.alistapart.com .. i've made many modifications that may not help you

// this function is need to work around 
// a bug in IE related to element attributes
function hasClass(obj) {
  var result = false;
  if (obj.getAttributeNode("class") != null) {
    result = obj.getAttributeNode("class").value;
    }
  return result;
  }   

var evenColor = '#FFFFFF';
var oddColor  = '#F0F0FF';

function stripe() {
  var tables = document.getElementsByTagName('table');
  if (! tables) { return; }
  for (var k = 0; k < tables.length; k++) {
    if (tables[k].className.match(/\bstripe\b/)) {
      var even = false;
      var tbodies = tables[k].getElementsByTagName("tbody");
      for (var h = 0; h < tbodies.length; h++) {
        var trs = tbodies[h].getElementsByTagName("tr");
        for (var i = 0; i < trs.length; i++) {
          if (!hasClass(trs[i]) && ! trs[i].style.backgroundColor) {
            var tds = trs[i].getElementsByTagName("td");
            for (var j = 0; j < tds.length; j++) {
              var mytd = tds[j];
              //mytd.className = even ? evenStyle : oddStyle; // class not workin' well in OP
              mytd.style.backgroundColor = even ? evenColor : oddColor;
              }
            }
          // flip from odd to even, or vice-versa
          even =  ! even;
          }
        }
      }
    }
  }

function addEvent(element, eventType, lamdaFunction, useCapture) {
  if (element.addEventListener) {
    element.addEventListener(eventType, lamdaFunction, useCapture);
    return true;
    } else if (element.attachEvent) {
    var r = element.attachEvent('on' + eventType, lamdaFunction);
    return r;
    } else {
    return false;
    }
}
addEvent(window, 'load', stripe, false);

