How To Style Directory Listings With Apache Mod_autoindex Using Namewidth & Htmltable?
Solution 1:
This can actually be done using only Apache directives. I'm very late answering this question, but I'm leaving this for future reference. This works for Apache v2.2+.
You can use CSS to style individual columns/elements using the IndexStyleSheet
directive:
Add an
IndexStyleSheet
directive just before yourHeaderName
line e.g.IndexStyleSheet /url/to/css/index_body.css
In
index_body.css
, set your preferred column padding withpadding-left
andpadding-right
properties and includealign
properties to replace the default HTMLalign
tags that will be automatically removed.th
classes refer to the column header labels;td
classes refer to the column contents; CSS class names are in the formatindexcol<column name>
:
/**
* Apache Auto-Index Style Sheet
* Created 10/03/2019
*//* Include padding to the right of the Name column */td.indexcolname {
padding-right: 1em;
}
/* Preserve the default alignment for the Last Modified column */td.indexcollastmod {
align: right;
}
/* Align the Size column header label and make the column wider */th.indexcolsize {
padding-left: 3em;
align: right;
}
/* Align the Size column values and make the column wider */td.indexcolsize {
padding-left: 3em;
align: right;
}
- Note: If your configuration includes the
IndexOptions SuppressHTMLPreamble
directive, the resulting Index page HTML will not automatically include a link to yourIndexStyleSheet
URL. You can manually add a link to yourHeaderName
file (header.html
, for this question):
<link href="/url/to/css/index_body.css" rel="stylesheet">
Solution 2:
I have created using php with css3,html5 and some jquery libraries
https://github.com/gsivaprabu/xampp-lampp-wampp-custom-index-file
Post a Comment for "How To Style Directory Listings With Apache Mod_autoindex Using Namewidth & Htmltable?"