Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Directory Listing Column Width

Tags:

html

.htaccess

When making a directory listing (.htaccess "Options +Indexes"), the default view has very narrow columns.

I set up a directory to demonstrate (it will be available for the duration of this question) containing some public domain artwork I made: link. The directory listing in Firefox looks like this: enter image description here

The listing in Chrome, IE, Safari, and Opera looks almost exactly the same. My concern here is that the width of the "Name" column is very narrow, especially in light of having a full HD screen with plenty of horizontal room.

The HTML is a simple table, with e.g. the "..>" signifying a longer filename being written explicitly in the HTML proper. So this is being generated by the HTTP server itself, I assume.

Is it possible to change this behavior so that file names can be longer? If not, why? If yes, how?

like image 964
imallett Avatar asked Apr 12 '15 05:04

imallett


1 Answers

Take a look at the IndexOptions directive in the .htaccess file. Specifically, the option NameWidth which you can set to either a certain number of characters or make it as wide as it needs to be:

IndexOptions NameWidth=40

for 40 character width for filename or

IndexOptions NameWidth=*

for auto width sizing. The options also allows you to set the widths of the other columns.

like image 52
Jon Lin Avatar answered Oct 20 '22 17:10

Jon Lin