Solved

On going body column layout

Posted on 2013-05-17
6
173 Views
Last Modified: 2013-05-17
I have been having a problem every time i try to make 3 columns float side by side. I start with dimensions that should work,
but never do. I adjust them until they finally line up side by side. I do not see how, but it works.
I have finally decided to get to the bottom of this and find what i am doing wrong.
Here is the page that does not work http://roofgenius.com/test.asp
body width 721px so the side adds are close to the table
table 461 px
add images 120px each + 10px margins each= 260px
 
  total 461
        260
        ----
        721
            The head portion is copied from a page I paid a coder to create and it works.
            What am i doing wrong ?
0
Comment
Question by:isnoend2001
  • 3
  • 3
6 Comments
 
LVL 15

Expert Comment

by:Jagadishwor Dulal
ID: 39174717
See the list of your mistake as you are wrote above you are using 120px for both sidebar but:

.bodywidth {
    width: 701px;
}

.leftcolumn {
    float: left;
    margin-right: 5px;
    width: 130px;
}
.rightColumn {
    float: left;
    margin-left: 5px;
    width: 130px;
}

Open in new window


Now your tables are not in centercolumn
<div class="centercolumn">


<h3>What size roofing nails to use</h3>
</div>

Open in new window

0
 
LVL 15

Accepted Solution

by:
Jagadishwor Dulal earned 500 total points
ID: 39174744
See this example what you want is:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<style type= "text/css">
table.NailTable {
	font-family: verdana,arial,sans-serif;
	width: 460px;
	font-size:11px;
	color:#333333;/*black*/
	border-width: 1px;
	border-color: #666666;/*dark gray */
	border-collapse: collapse;
	margin: auto;
}
table.NailTable th {
	border-width: 1px;
	padding: 4px;
	border-style: solid;
	border-color: #0066ff; /*blue */
	background-color: #f0f0f0;/*light gray */
}
table.NailTable td {
    height: 20px;
	border-width: 1px;
	padding: 2px;
	border-style: solid;
	border-color: #666666; /*dark gray */
	background-color: #ffffff;/*white */
}
table.NailTable .leftcol th{
width: 240px;
text-align: center;}

h1 { color:#000099;
	font:24px/22px Arial, Helvetica, sans-serif;
    font-weight: 600;
	text-align:center;
	}
h2 { font-size: 20px;
 font-weight: bold;
  text-align: center; }	
	
h3 { font-size: 16px;
 font-weight: bold;
  text-align: center; }
  
h4 { font-size: 11px;
 font-weight: bold;
  text-align: center; }
  
  
 .bodywidth{
 width: 761px; 
  } 
 .rightColumn{ 
 width: 120px; 
 float: left;
 margin-left:10px;
  	}
	.leftcolumn{
	width: 120px;
	float: left;
	margin-right:10px;
	
	 }
	 .centercolumn{
	 width: 461px;
	 float: left;
	 margin:0px auto;
	  }
</style>
</head>
<body>
<div class="bodywidth">
<div class="leftcolumn">
<img src="http://roofgenius.com/images/_TallAdRight.jpg" alt="" border="0" height="609" width="120">
</div><!--rightcolumn-->

<div class="centercolumn">


<h3>What size roofing nails to use</h3>

<table class="NailTable">
<caption><h3>Composition Shingles</h3></caption>
<tbody><tr>
	<th class="leftcol" rowspan="2"><h4>Comp Shingles</h4></th>
	<th colspan="4"><h4>Sheathing Thickness</h4></th>
	
	
</tr>
<tr>
	<th><h4>3/8"</h4></th>
	<th><h4>1/2"</h4></th>
	<th><h4>5/8"</h4></th>
	<th><h4>3/4"</h4></th>
	
	
</tr>
<tr>
	<td><h4>3-Tab comp shingles (Bare sheathing</h4></td>
	<td style="text-align: center">1"</td>
	<td style="text-align: center">1"</td>
	<td style="text-align: center">1"</td>
	<td style="text-align: center">1"</td>
	
	
</tr>
<tr>
	<td>Dimensional comp shingles (Bare sheathing)</td>
	<td style="text-align: center">1"</td>
	<td style="text-align: center">1-1/4"</td>
	<td style="text-align: center">1-1/4"</td>
	<td style="text-align: center">1-1/4"</td>
	
</tr>
<tr>
	<td>3-Tab comp shingles over 3 Tab comp shingles</td>
	<td style="text-align: center">1-1/4"</td>
	<td style="text-align: center">1-1/4"</td>
	<td style="text-align: center">1-1/4"</td>
	<td style="text-align: center">1-1/2"</td>	
</tr>
<tr>
	<td>Dimensional comp shingles over 3 Tab</td>
	<td style="text-align: center">1-1/4"</td>
	<td style="text-align: center">1-1/2"</td>
	<td style="text-align: center">1-1/2"</td>
	<td style="text-align: center">1-1/2"</td>	
</tr>
</tbody></table>
<br>

<table class="NailTable">
<caption><h3>Wood Shakes(minimum 3/4 " sheathing)</h3></caption>
<tbody><tr>
	<th class="leftcol">Wood Shakes</th>
	<th class="leftcol">Nail Type</th>
	<th class="leftcol">Minimum Length</th>
	</tr><tr>
	<td>18" Straight Split</td>
	<td style="text-align: center">5d Box</td>
	<td style="text-align: center">1-3/4"</td>	
	</tr><tr>
	<td>
	18" and 24" Handsplit and Resawn 
	</td>
	<td style="text-align: center">6d Box</td>
	<td style="text-align: center">2"</td>
	</tr>
	<tr><td>
	24" Tapersplit</td> 
	<td style="text-align: center">5d Box</td>
	<td style="text-align: center">1-3/4"</td>
	</tr><tr>
	<td>18" and 24" Tapersawn</td>
	<td style="text-align: center">6d Box</td>
	<td style="text-align: center">2"</td>
	</tr>	
	</tbody></table>
	<br>
	<table class="NailTable">
<caption><h3>Wood Shingles(minimum 3/4 " sheathing)</h3></caption>
<tbody><tr>
	<th class="leftcol">Wood Shingles</th>
	<th class="leftcol">Nail Type</th>
	<th class="leftcol">Minimum Length</th>
	</tr><tr>
	<td>18" Straight Split</td>
	<td style="text-align: center">3d Box</td>
	<td style="text-align: center">1-1/4"</td>	
	</tr><tr>
	<td>
	18" and 24" Handsplit and Resawn 
	</td>
	<td style="text-align: center">4d Box</td>
	<td style="text-align: center">1-1/2"</td>
	</tr>
	</tbody></table>
	</div><!--centercolumn-->
	<div class="rightColumn">
<img src="http://roofgenius.com/images/_TallAd2.jpg" alt="" border="0" height="609" width="120">
</div><!--leftcolumn-->
	 <!--bodywidth-->   
  

</body>
</html>

Open in new window

0
 

Author Comment

by:isnoend2001
ID: 39174748
Thanks agadishdulal i do not understand your answer
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Closing Comment

by:isnoend2001
ID: 39174835
Thanks
that works I will have to examine your code to see what i was doing wrong.
How do i center all 3 columns in the page ?
0
 
LVL 15

Expert Comment

by:Jagadishwor Dulal
ID: 39175334
Update your style sheet:

.bodywidth {
    width: 701px;
    margin:0 auto;

}

Open in new window

0
 

Author Comment

by:isnoend2001
ID: 39175373
Thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
flex div overflows its container 4 35
Create tabs to show divs 9 45
[Bootstrap] Navigation Bar Collapse 27 40
Execute jQuery after Function 4 10
When applying CSS to your HTML, there are many different ways to select which element(s) the CSS applies to.  Some of these selectors are more commonly known and used than others - Here are the more common ones: #X - Matches an ID of X .X - Matche…
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question