Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Table within div breaks layout
Old 10-03-2007, 12:55 PM Table within div breaks layout
joder's Avatar
Flipotron

Posts: 6,442
Name: James
Location: In the ocean.
Trades: 0
The code below works jiffy until I put a table within the Primary Content area. Then the secondarycontent is still on the right but pushed below the primary content. BTW, the table is for tabular data.

CSS:
Code:
#container {
    position: relative;
    margin: 0px 40px 0px 40px;
    }
 
#primarycontainer {
    float: left;
    margin-right: 230px;
    }
 
#primarycontent {
    margin-right: 240px;
    }
 
#primarycontent p {
    margin-bottom: 20px;
    }
 
#secondarycontent {
    float: right;
    width: 200px;
    border-left: 1px #aaa dotted;
    }
    
 .clearit {
    clear: both;
    height: 1px;
    }
HTML:
HTML Code:
<div id="container"> 
    <div id="primarycontainer"> 
        <div id="primarycontent"> 
        
            <!-- Primary content  -->
                        
        </div>
    </div>
        
    <div id="secondarycontent">  <!-- aka right sidebar -->
        <ul>
        <li class="subMenuTitle">Main</li>
        <li><a href="/documentation/">Documentation</a></li>
        <li><a href="/monitoring/">Monitoring</a></li>
        <li><a href="/bookmarks/">Bookmarks</a></li>
        <li><a href="/contact/">Contact Us</a></li>
    </ul>
    </div>
              
    <div class="clearit"></div>
              
</div>
joder is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-03-2007, 01:03 PM Re: Table within div breaks layout
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
Have you tried explicitly setting the table width?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 10-03-2007, 01:09 PM Re: Table within div breaks layout
joder's Avatar
Flipotron

Posts: 6,442
Name: James
Location: In the ocean.
Trades: 0
It wasn't set. But I set it and the secondary div is in the same postition.
joder is offline
Reply With Quote
View Public Profile
 
Old 10-03-2007, 02:21 PM Re: Table within div breaks layout
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
I think I see why. You have margins on both your primary container and primary content divs, which add up to 470 pixels. Your sidebar div is 200 pixels wide. That means you've used 670 pixels of space up before you even put content into the primary content div.

Take out some of that white space, and you'll at least be closer to fine.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 10-04-2007, 11:58 AM Re: Table within div breaks layout
joder's Avatar
Flipotron

Posts: 6,442
Name: James
Location: In the ocean.
Trades: 0
Thanks for the help Adam. Turns out the fix was to put the right div before the left one. I've done this several times before and should have known.
joder is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Table within div breaks layout
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.14856 seconds with 12 queries