This is for non-dynamic tables.
I'm well aware that it's very easy to stripe tables generated from a database on the backend....it only takes one line of code, actually. I don't use PHP, but I'm sure you can pull off something like the following (which is written in ColdFusion):
Code:{tr {cfif NOT query.currentRow MOD 2}class="alt-bg"{/cfif}}
Replace the swirly brackets, or whatever they're called, with angled brackets...A2K is stripping out tag attributes if I use angled brackets.
Also note that I've improved the hassClass() and addClass() functions above, but in the process A2K stripped out the attributes for my <style> and <script> tags (this feature has obviously been implemented since I originally posted this). I also had to remove the HTML comments within my style and script tags, because they were causing big blocks of (but not all) the code inside to be removed, for whatever reason.
If you wanted to, you could write a back-end parser that would accomplish the same thing as the JavaScript above for static tables. With .NET's support of regex balancing groups (a solution for handling recursion) you could probably process the entire page with one line of code, but no regex engine aside from .NET's (certainly not PHP's) supports balancing groups.
And as a footnote, you could remove the addLoadEvent() function fom the above code if you want to just run stripeTables() from body onload.