DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Problem with alignment of checkboxes in HTML page

  1. #1
    Join Date
    Jul 2006
    Posts
    91

    Problem with alignment of checkboxes in HTML page

    Hi,

    I have placed several check boxes inside a table element, that show up in a single row,
    on a html page. The problem is that when I shrink the web page the check boxes alignment
    goes off, that is they start to show up in mutiple rows on the web page. What I want to
    achieve is that, how much ever I shrink my web page, the check boxes must maintain there
    alignment i.e. they should not split into multiple rows. How can I do that?.Do I have to use any JS script for that?.If so please suggest me.
    I have around 8 check boxes, showing up in a single row. Width and Height of the table are
    set to 100% and 50 respectively.The check boxes are HTML based.

    Thanks,

  2. #2
    Join Date
    Oct 2005
    Location
    Maady
    Posts
    1,819
    Don't use a 100% but a fixed width .. the browser do that to prevent the apparition of horizontal scrollbars ... but for fixed size it will force the scrollbars to appear ...
    Programmer&Cracker CS
    MyBlog:Blog.Amahdy.com
    MyWebsite:www.Amahdy.com

  3. #3
    Join Date
    Mar 2007
    Location
    Bangalore, India
    Posts
    247
    In addition to setting width="100%", try setting the CSS attribute minWidth to a pixel value (say 100px or whatever you find appropriate according to your maximum width of checkbox labels). If you wanted to set the width dynamically, you would have to use JavaScript.
    If you don't know CSS, setting min-width (minWidth in JavaScript/DOM) can be done by setting the style attribute of the <td> element or <table> element like so:
    <table width="100%" style="min-width:100px">...
    Last edited by Razee Marikar; 11-13-2007 at 08:38 AM. Reason: Mistake: it should min-width was written as minWidth

  4. #4
    Join Date
    Feb 2006
    Location
    Minnesota
    Posts
    33

    Nowrap

    If the checkboxes are all in the same cell, you can use the NOWRAP option:

    <TD .... NOWRAP>

Similar Threads

  1. Embed html page in aspx page(Cross Domain Security)
    By prashant2010 in forum ASP.NET
    Replies: 0
    Last Post: 02-13-2007, 09:51 AM
  2. generate Office HTML : DATE PROBLEM
    By tyris in forum XML
    Replies: 1
    Last Post: 10-04-2006, 06:06 AM
  3. run dos command from html page
    By steve hamilton in forum Web
    Replies: 3
    Last Post: 05-20-2002, 07:00 PM
  4. Replies: 1
    Last Post: 05-07-2002, 10:32 AM
  5. Replies: 0
    Last Post: 10-18-2001, 07:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center