Index: mod_autoindex.c
===================================================================
--- mod_autoindex.c	(revision 894077)
+++ mod_autoindex.c	(working copy)
@@ -1482,6 +1482,7 @@
                                char direction, const char *colargs)
 {
     int x;
+    int row_count;
     apr_size_t rv;
     char *name = r->uri;
     char *tp;
@@ -1530,9 +1531,9 @@
 
     if (autoindex_opts & TABLE_INDEXING) {
         int cols = 1;
-        ap_rputs("<table><tr>", r);
+        ap_rputs("<table class=\"ai_table\"><tr>", r);
         if (!(autoindex_opts & SUPPRESS_ICON)) {
-            ap_rputs("<th>", r);
+            ap_rputs("<th class=\"ai_th\">", r);
             if ((tp = find_default_icon(d, "^^BLANKICON^^"))) {
                 ap_rvputs(r, "<img src=\"", ap_escape_html(scratch, tp),
                              "\" alt=\"[ICO]\"", NULL);
@@ -1554,30 +1555,30 @@
 
             ++cols;
         }
-        ap_rputs("<th>", r);
+        ap_rputs("<th class=\"ai_th\">", r);
         emit_link(r, "Name", K_NAME, keyid, direction,
                   colargs, static_columns);
         if (!(autoindex_opts & SUPPRESS_LAST_MOD)) {
-            ap_rputs("</th><th>", r);
+            ap_rputs("</th><th class=\"ai_th\">", r);
             emit_link(r, "Last modified", K_LAST_MOD, keyid, direction,
                       colargs, static_columns);
             ++cols;
         }
         if (!(autoindex_opts & SUPPRESS_SIZE)) {
-            ap_rputs("</th><th>", r);
+            ap_rputs("</th><th class=\"ai_th\">", r);
             emit_link(r, "Size", K_SIZE, keyid, direction,
                       colargs, static_columns);
             ++cols;
         }
         if (!(autoindex_opts & SUPPRESS_DESC)) {
-            ap_rputs("</th><th>", r);
+            ap_rputs("</th><th class=\"ai_th\">", r);
             emit_link(r, "Description", K_DESC, keyid, direction,
                       colargs, static_columns);
             ++cols;
         }
         if (!(autoindex_opts & SUPPRESS_RULES)) {
             breakrow = apr_psprintf(r->pool,
-                                    "<tr><th colspan=\"%d\">"
+                                    "<tr><th class=\"ai_th\" colspan=\"%d\">"
                                     "<hr%s></th></tr>\n", cols,
                                     (autoindex_opts & EMIT_XHTML) ? " /" : "");
         }
@@ -1658,7 +1659,23 @@
         }
 
         if (autoindex_opts & TABLE_INDEXING) {
-            ap_rputs("<tr>", r);
+            ap_rputs("<tr", r);
+
+            /* Even/Odd rows for IndexStyleSheet */
+            if (d->style_sheet != NULL) {
+                ap_rputs(" class=\"ai_tr ", r);
+                if ( row_count % 2 == 0 ) {
+                    ap_rputs("ai_tr_even", r);
+                }
+                else {
+                    ap_rputs("ai_tr_odd", r);
+                }
+                ap_rputs("\"", r);
+                row_count++;
+            }
+
+            ap_rputs(">", r);
+
             if (!(autoindex_opts & SUPPRESS_ICON)) {
                 ap_rputs("<td valign=\"top\">", r);
                 if (autoindex_opts & ICONS_ARE_LINKS) {
