IndexStyleSheet "/css/style.css"
</code></p></div>
+ <p>Using this directive in conjunction with <code>IndexOptions
+ HTMLTable</code> also adds <code>ai-tr-odd</code> and
+ <code>ai-tr-even</code> class declarations to alternating rows of
+ the directory listing table, so that you can style alternate rows of
+ the table differently.</p>
+
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="ReadmeName" id="ReadmeName">ReadmeName</a> <a name="readmename" id="readmename">Directive</a></h2>
<title>Example</title>
IndexStyleSheet "/css/style.css"
</example>
+
+ <p>Using this directive in conjunction with <code>IndexOptions
+ HTMLTable</code> also adds <code>ai-tr-odd</code> and
+ <code>ai-tr-even</code> class declarations to alternating rows of
+ the directory listing table, so that you can style alternate rows of
+ the table differently.</p>
</usage>
</directivesynopsis>
char direction, const char *colargs)
{
int x;
+ int row_count;
apr_size_t rv;
char *name = r->uri;
char *tp;
}
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=\"", 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) {