Tab character in JSp

Posted on 2004-11-22
Medium Priority
Last Modified: 2013-12-03
I need to allign entries in HTML Option Value box the following way:

October 09, 2004        02:25 AM
September 21, 2004      10:44 PM
March 24, 2004      00:23 AM

HTML code is composed inside JSP.
Using spaces does not work, and HTML does not understand tab character.
Any help will be greatly appreciated.
Question by:burevestnik
LVL 35

Accepted Solution

TimYates earned 500 total points
ID: 12649578
You're not going to be able to do that, AFAIK, as each browser can be using a different font, which would break any spacing you manage to get into it...

I would either do;

a)  An html table that you can select a row of
b)  Have a select that shows extra data (in a space next to the select) when an item is selected
LVL 28

Expert Comment

ID: 12651049
>Using spaces does not work, and HTML does not understand tab character  
You can use the non-break space character.  Use       or    
LVL 35

Expert Comment

ID: 12652531
But you won't guarantee 100% alignment on 100% of browsers...
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.


Expert Comment

ID: 12656808
Hi burevestnik

You can use either   for five times,

or u can use div tag to specift ur style and padding to that

ex : <DIV
            style="PADDING-LEFT: 10px; FONT-SIZE: 12px; COLOR: #000000; FONT-FAMILY: arial">
ur text

LVL 35

Expert Comment

ID: 12656842
how does that line up columns in an HTML select?

that just adds padding to the left hand side of the select...


Expert Comment

ID: 12657005
yes, U are right


Assisted Solution

PeterCiuffetti earned 500 total points
ID: 12668643
Here's some HTML that will align using monospace font family and &nbsp; as the space character:

      <head><title>Option alignment</title></head>
            <h1>Demonstration of option alignment</h1>
            <form action="." method="get">
                  <select name="op1">
                        <option value="1">October 09, 2004       02:25 AM</option>
                        <option value="1">September 21, 2004     10:44 PM</option>
                        <option value="1">March 24, 2004     00:23 AM</option>
                  <p>Line up the times</p>
                  <select name="op2" style="font-family:monospace;">
                        <option value="1" selected="selected">October 09, 2004&nbsp;&nbsp;&nbsp;02:25 AM</option>
                        <option value="2">September 21, 2004&nbsp;10:44 PM</option>
                        <option value="3">March 24, 2004&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;00:23 AM</option>
                  <p>Align the days</p>
                  <select name="op3" style="font-family:monospace;">
                        <option value="1" selected="selected">October&nbsp;&nbsp;&nbsp;09, 2004 02:25 AM</option>
                        <option value="2">September&nbsp;21, 2004 10:44 PM</option>
                        <option value="3">March&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;24, 2004 00:23 AM</option>
                  <input type="submit" name="submit"/>

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month15 days, 22 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question