diff --git a/docs/manual/mod/mod_autoindex.xml b/docs/manual/mod/mod_autoindex.xml
index d5c3a61c5a..bb2ee18fa3 100644
--- a/docs/manual/mod/mod_autoindex.xml
+++ b/docs/manual/mod/mod_autoindex.xml
@@ -934,6 +934,12 @@ Name|Date|Size|Description
Example
IndexStyleSheet "/css/style.css"
+
+
Using this directive in conjunction with IndexOptions
+ HTMLTable
also adds ai-tr-odd
and
+ ai-tr-even
class declarations to alternating rows of
+ the directory listing table, so that you can style alternate rows of
+ the table differently.
diff --git a/modules/generators/mod_autoindex.c b/modules/generators/mod_autoindex.c
index 8d93f63368..b6669421bd 100644
--- a/modules/generators/mod_autoindex.c
+++ b/modules/generators/mod_autoindex.c
@@ -1482,6 +1482,7 @@ static void output_directories(struct ent **ar, int n,
char direction, const char *colargs)
{
int x;
+ int row_count;
apr_size_t rv;
char *name = r->uri;
char *tp;
@@ -1658,7 +1659,23 @@ static void output_directories(struct ent **ar, int n,
}
if (autoindex_opts & TABLE_INDEXING) {
- ap_rputs("
", r);
+ ap_rputs("
style_sheet != NULL) {
+ ap_rputs(" class=\"", 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("", r);
if (autoindex_opts & ICONS_ARE_LINKS) {
|