Solved

On going body column layout

Posted on 2013-05-17
6
171 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

807 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