Maintaining white space in html select tag
Posted
by Marius
on Stack Overflow
See other posts from Stack Overflow
or by Marius
Published on 2010-05-18T14:14:12Z
Indexed on
2010/05/18
14:20 UTC
Read the original article
Hit count: 256
Hi,
I have a list of strings that I would like to display in a HTML select object. The strings look something like :
id - name - description
I would like the fields to align however. In PHP I'm using
sprintf ("%4s%10s%20s", $id, $name, $description);
which works fine. The problem is the multiple spaces is compacted to 1 space in the select list. I tried using the pre and white-space CSS properties of the select box, but it has no effect. Any suggestions?
© Stack Overflow or respective owner