SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 31 of 31
  1. #26
    3MTA3
    Join Date
    Jul 2003
    Location
    Florida
    Posts
    1,016
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by stymiee
    I kow tables aren't evil and are ok to us but this isn't tabular data and I would feel a lot cooler if I could avoid it. So, what's worse: using a table or lots of DIVs? (This is more of an opinion thing and that's all I'm looking for).
    IMO if you are doing a tableless design, I think using tables would be worse. A List Apart has an article that discusses this issue (about half way down the page):
    http://www.alistapart.com/articles/practicalcss/

  2. #27
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,328
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    my point was, you can style a series of checkboxes quite nicely without using either table or divs

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #28
    Non-Member c1vineoflife's Avatar
    Join Date
    Sep 2004
    Location
    CA
    Posts
    460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by stymiee
    Ya know, once you get that whole block/inline and padding/margin thing down, it's all downhill.

    Anyway, here's my newest dilema. I'm designing a form and I'm at a point where I'll need to use a lot of checkboxes. I can envision how to do it but I'm afraid it might be overkill of DIVs. But the alternative is to use a table. I kow tables aren't evil and are ok to us but this isn't tabular data and I would feel a lot cooler if I could avoid it. So, what's worse: using a table or lots of DIVs? (This is more of an opinion thing and that's all I'm looking for).
    Well, I think it's ok to use a table when you have really complex forms. I have never made a form larger than a few input boxes and a textarea, so I can't say from personal opinion. You could always use divs, and then us an unordered list to display the checkboxes:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>
    Checkboxes in an unordered list?!?!?!
    </title>
    
    <style type="text/css">
    
    body {
    	background-color: #bd957a;
    }
    
    #checkboxes {
    	background-color: #cca32a;
    	border: 1px dotted #666;
    	padding: 4px;
    	margin-top: 80px;
    	margin-right: auto;
    	margin-left: auto;
    	vertical-align: middle;
    	width: 360px;
    }
    
    #checkboxes ul {
    	display: block;
    }
    
    #checkboxes ul .checkHead {
    	font: bold 11pt/12pt arial, verdana, helvetica, sans-serif;
    	margin-bottom: 4px;
    	margin-left: -20px;
    }
    
    #checkboxes ul li {
    	font: 9pt/10pt arial, verdana, helvetica, sans-serif;
    	list-style-type: none;
    	margin-left: -16px;
    }
    
    </style>
    
    </head>
    <body>
    
    <div id="checkboxes">
    <ul>
     <li class="checkHead">I like...</li>
     <li><input type="checkbox" name="box9" value="9"> - books</li>
     <li><input type="checkbox" name="box7" value="7"> - cars</li>
     <li><input type="checkbox" name="box3" value="3"> - computers</li>
     <li><input type="checkbox" name="box1" value="1"> - pizza</li>
     <li><input type="checkbox" name="box8" value="8"> - school</li>
     <li><input type="checkbox" name="box2" value="2"> - shoes</li>
     <li><input type="checkbox" name="box6" value="6"> - things</li>
     <li><input type="checkbox" name="box4" value="4"> - video games</li>
     <li><input type="checkbox" name="box5" value="5"> - web design</li>
     <li><input type="checkbox" name="box10" value="10" checked="checked"> - Yes, I would like to give William $1,000,000!</li>
    </ul>
    </div>
    
    </body>
    </html>
    That was quite easy to make, and it is very customizable. It's also easy the change how many checkboxes you have and so on. Oh, and forgive the colors, please. I don't know what I was thinking.

  4. #29
    Non-Member c1vineoflife's Avatar
    Join Date
    Sep 2004
    Location
    CA
    Posts
    460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by r937
    my point was, you can style a series of checkboxes quite nicely without using either table or divs

    Agreed 100%

  5. #30
    SitePoint Addict Tim_Rogovets's Avatar
    Join Date
    Aug 2003
    Location
    Odessa, Ukraine
    Posts
    221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by r937
    my point was, you can style a series of checkboxes quite nicely without using either table or divs
    That's the beauty of CSS - you can set styles to almost everything on your pages and decide how would the elements look like, how would they be placed on the page, etc. The exception is the file upload form field . I hate it.
    CEO of Grandiz! - a team based in Odessa, Ukraine.
    Designing and developing sophisticated web apps on CodeIgniter!

  6. #31
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,481
    Mentioned
    182 Post(s)
    Tagged
    6 Thread(s)
    There is already a thread here discussing forms which may be useful.

    http://www.sitepoint.com/forums/showthread.php?t=206940

    Paul


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •