Click here to Skip to main content
15,885,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
So I have a dropdown menu on an html page:
style="font-family: Courier New;


And all I want to do is line up the choices with descriptions, but my expected tab stops don't line up exactly

So in the menu dropdown I have:

Um, can't paste in company data, but Family model name then family member name but it doesn't work like regular tabs.

Am I missing something? I thought the whole idea of monospaced fonts was to deal with this very situation

What I have tried:

"4 spaces:  "
"2 spaces:  "

Same result with Edge, IE, Chrome which are the only allowable company browser choices
Posted
Updated 17-Feb-21 0:21am
Comments
Peter_in_2780 17-Feb-21 2:20am    
I'm not sure exactly what you are after, but in that situation I'd use a 2-column table. Browsers are very smart at laying out tables. You can control text alignment per-column.
Peter_in_2780 17-Feb-21 2:22am    
Also, whitespace in HTML is not significant in the final layout. Put as many spaces, tabs, newlines as you like, it'll only render one space.

I had the same problem.
https://www.codeproject.com/Questions/5294374/Why-the-VB-NET-webbrowser-control-shows-only-one-b

using " " instead of a space helped me.
 
Share this answer
 
You probably need to use the white-space CSS property to control how your spaces are treated.
white-space - CSS: Cascading Style Sheets | MDN[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900