Solved

On going body column layout

Posted on 2013-05-17
6
165 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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Creating a CSS block that only applies to printing By default, all of your CSS applies to every possible view of your page - whether on screen, printed, landscape, touch-screen, or whatever.  You can, however, add CSS that only applies under certai…
As a result of several questions about how to use Bootstrap I thought it would be a good idea to write down the development aspect of creating a Bootstrapped website in as little time as possible. Part 1 of this article will only concentrate on g…
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…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

746 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now