SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    gimme the uuuuuuuuuuu duuudie's Avatar
    Join Date
    Feb 2004
    Location
    Switzerland
    Posts
    2,253
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    I used to do it using tables, how can I do it with css?

    Hi

    Code:
     <table> 
    <tr>
    <td>
    1
    </td>
    <td>
    2
    </td>
    <td>
    3
    </td>
    </tr>
    <tr>
    <td>
    4
    </td>
    <td>
    5
    </td>
    <td>
    6
    </td>
    </tr>
    </table>
    Si it possible to achieve the same thing without using the table tags? just using CSS?

    Thanks a lot for your precious time.

  2. #2
    Non-Member Egor's Avatar
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    7,305
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    yes its possible, use div's

  3. #3
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,340
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    It all depends on what you do next but a simple way is like this:
    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">
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    </head>
    <style type="text/css">
    .outer {width:45px;height:40px;}
    .inner {width:15px;height:20px;float:left}
    </style>
    <body>
    <div class="outer"> 
      <div class="inner">1</div>
      <div class="inner">2</div>
      <div class="inner">3</div>
      <div class="inner">4</div>
      <div class="inner">5</div>
      <div class="inner">6</div>
    </div>
    </body>
    </html>
    Paul

  4. #4
    gimme the uuuuuuuuuuu duuudie's Avatar
    Join Date
    Feb 2004
    Location
    Switzerland
    Posts
    2,253
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks you so much Paul, you're always such a great help.

    It works perfectly. How come that the second line is created? I'm not sure I get it...

    thanks again for being such a nice person Paul.

  5. #5
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,340
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Hi,
    How come that the second line is created? I'm not sure I get it...
    The floats are floated in an outer that is only wide enough to hold three floats so the fourth float drops to the next line.

    Paul

  6. #6
    gimme the uuuuuuuuuuu duuudie's Avatar
    Join Date
    Feb 2004
    Location
    Switzerland
    Posts
    2,253
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    he he... hadn't time to read that article about floats yet

    it makes sense.

    thanks a lot 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
  •