Tab character in JSp

Posted on 2004-11-22
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

    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 27

    Expert Comment

    >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

    But you won't guarantee 100% alignment on 100% of browsers...
    LVL 1

    Expert Comment

    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

    how does that line up columns in an HTML select?

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

    LVL 1

    Expert Comment

    yes, U are right

    LVL 6

    Assisted Solution

    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

    Gigs: Get Your Project Delivered by an Expert

    Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

    Join & Write a Comment

    Suggested Solutions

    Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
    Read about the 3 stages of the buyer's journey: awareness, consideration, and decision.
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    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…

    745 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

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now