JimM
Sep 7th, 2007, 06:50 PM
I'm Switching from a table layout to css type layout. This is just an example of the header section, the various columns widths may very (that is why all the short, med, longs have been setup.
This is some code I'm taking over and they tend to use a lot of divs with float lefts to set stuff up on the same line, is this the proper way to do it or is there a better way. This method is being used for both table data and forms.
CSS:
.box_wraper { margin:0 auto; padding: 10px; border: 1px solid #0000CD; }
.box_content {padding: 5px; }
.boxclear { clear: both; margin: 0px auto; font-size: 0px; }
.boxspace { clear: both; margin: 2px auto; font-size: 0px; }
.xxx-short { float: left; width: 5px; }
.xx-short { float: left; width: 10px; }
.x-short { float: left; width: 40px; }
.xmshort { float: left; width: 50px; }
.short { float: left; width: 60px; }
.xsmed { float: left; width: 70px; }
.smed { float: left; float: left; width: 80px; }
.med { float: left; width: 100px; }
.xmed { float: left; width: 125px; }
.xxmed { float: left; width: 150px; }
.long { float: left; width: 150px; }
.x-long { float: left; width: 200px; }
.xxs-long { float: left; width: 235px; }
.xx-long { float: left; width: 250px; }
.xxx-long { float: left; width: 300px; }
.xxxx-long { float: left; width: 350px; }
.xxxxx-long { float: left; width: 400px; }
.xxxxxx-long { float: left; width: 450px; }
.xxxxxxx-long { float: left; width: 500px; }
html:
<div class="box_wraper">
<div class="box_content">
<h1>Header (One Column W/Float LEFT)</h1>
<div><a href="#" class="med">Project</a></div>
<div><a href="#" class="long">Name</a></div>
<div><a href="#" class="short">Status</a></div>
<div><a href="#" class="x-short">Type</a></div>
<div><a href="#" class="med">Live Date</a></div>
<div><a href="#" class="short">Owner</a></div>
</div>
<div class="boxclear"> </div>
</div>
<div class="boxspace"> </div>
<div class="box_wraper">
<div class="box_content">
<h1>Header (One Column W/Float LEFT)</h1>
<div><a href="#" class="long">Project</a></div>
<div><a href="#" class="x-long">Task</a></div>
<div><a href="#" class="short">Due Date</a></div>
<div><a href="#" class="short">Completed Date</a></div>
</div>
<div class="boxclear"> </div>
</div>
<div class="boxspace"> </div>
Thanks in advance for any input and/or help
This is some code I'm taking over and they tend to use a lot of divs with float lefts to set stuff up on the same line, is this the proper way to do it or is there a better way. This method is being used for both table data and forms.
CSS:
.box_wraper { margin:0 auto; padding: 10px; border: 1px solid #0000CD; }
.box_content {padding: 5px; }
.boxclear { clear: both; margin: 0px auto; font-size: 0px; }
.boxspace { clear: both; margin: 2px auto; font-size: 0px; }
.xxx-short { float: left; width: 5px; }
.xx-short { float: left; width: 10px; }
.x-short { float: left; width: 40px; }
.xmshort { float: left; width: 50px; }
.short { float: left; width: 60px; }
.xsmed { float: left; width: 70px; }
.smed { float: left; float: left; width: 80px; }
.med { float: left; width: 100px; }
.xmed { float: left; width: 125px; }
.xxmed { float: left; width: 150px; }
.long { float: left; width: 150px; }
.x-long { float: left; width: 200px; }
.xxs-long { float: left; width: 235px; }
.xx-long { float: left; width: 250px; }
.xxx-long { float: left; width: 300px; }
.xxxx-long { float: left; width: 350px; }
.xxxxx-long { float: left; width: 400px; }
.xxxxxx-long { float: left; width: 450px; }
.xxxxxxx-long { float: left; width: 500px; }
html:
<div class="box_wraper">
<div class="box_content">
<h1>Header (One Column W/Float LEFT)</h1>
<div><a href="#" class="med">Project</a></div>
<div><a href="#" class="long">Name</a></div>
<div><a href="#" class="short">Status</a></div>
<div><a href="#" class="x-short">Type</a></div>
<div><a href="#" class="med">Live Date</a></div>
<div><a href="#" class="short">Owner</a></div>
</div>
<div class="boxclear"> </div>
</div>
<div class="boxspace"> </div>
<div class="box_wraper">
<div class="box_content">
<h1>Header (One Column W/Float LEFT)</h1>
<div><a href="#" class="long">Project</a></div>
<div><a href="#" class="x-long">Task</a></div>
<div><a href="#" class="short">Due Date</a></div>
<div><a href="#" class="short">Completed Date</a></div>
</div>
<div class="boxclear"> </div>
</div>
<div class="boxspace"> </div>
Thanks in advance for any input and/or help