How do i horizontally center my Listbox

Posted on 2005-05-17
Last Modified: 2010-04-07
Sometimes this new interface baffles me.
My listbox seems to refuse being centered horizontally.
Tried setting the Table1.align to Center but to no avail.
Whats going on?

Question by:tcalbaz
    LVL 5

    Accepted Solution

    Hi tcalbaz,

    do like this

      <div id="temp" style="valign:center;">
            ...your list box

    LVL 9

    Expert Comment

    There are various ways to do this...  one is above.  If your control is contained within a table, it is most like part of a cell.  Therefore another way to do it is to set the attribute of the TD tag:

              <td align="center">...YOUR CONTROL HERE...</td>

    Also, if you are using stylesheets and want to have this as a "global" default or use it in a style class:

         text-align: center;

         text-align: center;

    In the example having a class, it would be used like so:

              <td class="tdCenter">...YOUR CONTROL HERE...</td>
    LVL 1

    Author Comment


    That did it!
    Thank you so much.


    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
    This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    734 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

    20 Experts available now in Live!

    Get 1:1 Help Now