how to create 2 inline tables 1 main content 1 sidebar

Discussion in 'CSS' started by PinoyEngine™, Nov 5, 2009.

  1. #1
    hello! I just want to ask how to create 2 inline tables 1 main content 1 sidebar.

    The Main table is floated on the left.
    The sidebar table is floated on the right.

    The sidebar table should be 200px on width.
    And the main table should get the remaining space, so both of them will fit 100% screen.
    A very fluid one.

    Thanks in advance and more power.
     
    PinoyEngine™, Nov 5, 2009 IP
  2. unigogo

    unigogo Peon

    Messages:
    286
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    unigogo, Nov 5, 2009 IP
  3. LeetPCUser

    LeetPCUser Peon

    Messages:
    711
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #3
    That link works but looks a bit bulky. Here is the short-hand way if you want to know how.

    CSS
    
    #container
    {
     float:left;
     width:900px;
    }
    
    #leftCol
    {
     float:left;
     width:290px;
     padding-right:10px;
    }
    
    #rightCol
    {
     float:right;
     width:600px;
    }
    
    Code (markup):
    HTML
    
    <div id="content">
     <div id="leftCol">
       <p>left column text goes here</p>
     </div>
    
     <div id="rightCol">
      <p>right column text goes here</p>
     </div>
    </div>
    
    Code (markup):
     
    LeetPCUser, Nov 5, 2009 IP
  4. unigogo

    unigogo Peon

    Messages:
    286
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #4
    unigogo, Nov 5, 2009 IP