sterlingcooper
07-06-2011, 07:49 AM
Hi,
I have a table set up with HTML and CSS and I am happy with it except that I'm not sure how to make the table not stretch but to stay a certain width.
If you look at the code, the th of "Retail Price" adds too much space to the numbers underneath. I need the 1, 2-24 etc. ths to be consistently spaced.
Any thoughts on how I could fix this?
Thanks much.
<html>
<style type="text/css">
body
{
line-height: 1.6em;
}
.catalogPrice
{
font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
font-size: 12px;
/*background: #fff;*/
/*margin: 45px;*/
width: 1000px;
border-collapse: collapse;
text-align: left;
}
.catalogPrice th
{
font-size: 14px;
font-weight: bold;
color: black;
/*padding: 10px 8px;*/
padding-right: 8px;
padding-left: 8px;
padding-bottom: 1px;
/*border-bottom: 2px solid #6678b1;*/
}
.catalogPrice td
{
border-bottom: 1px solid #ccc;
color: gray;
font-size: 13px;
padding: 6px 8px;
}
</style>
<body>
<div class="catalogPriceWrapper">
<table class="catalogPrice">
<thead>
<tr>
<th scope="col"></th>
<th scope="col"></th>
<th scope="col">Overall Size</th>
<th scope="col">Printable</th>
<th scope="col">Retail Price Goes Underneath This Long Line here. </th>
</tr>
<tr>
<th scope="col">Description</th>
<th scope="col">Style No.</th>
<th scope="col">(WxH)</th>
<th scope="col">Area</th>
<th scope="col">1</th>
<th scope="col">2-24</th>
<th scope="col">25-99</th>
<th scope="col">100+</th>
</tr>
</thead>
<tbody>
<tr>
<td>Product Name</td>
<td>ABCDE</td>
<td>6'' x 8'' x 2 1½''</td>
<td>2 ¾'' x 5''</td>
<td>$74.50</td>
<td>$68.02</td>
<td>$67.59</td>
<td>$66.94 <strong>(P)</strong></td>
</tr>
</tbody>
</table>
</div>
</body>
</html>
I have a table set up with HTML and CSS and I am happy with it except that I'm not sure how to make the table not stretch but to stay a certain width.
If you look at the code, the th of "Retail Price" adds too much space to the numbers underneath. I need the 1, 2-24 etc. ths to be consistently spaced.
Any thoughts on how I could fix this?
Thanks much.
<html>
<style type="text/css">
body
{
line-height: 1.6em;
}
.catalogPrice
{
font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
font-size: 12px;
/*background: #fff;*/
/*margin: 45px;*/
width: 1000px;
border-collapse: collapse;
text-align: left;
}
.catalogPrice th
{
font-size: 14px;
font-weight: bold;
color: black;
/*padding: 10px 8px;*/
padding-right: 8px;
padding-left: 8px;
padding-bottom: 1px;
/*border-bottom: 2px solid #6678b1;*/
}
.catalogPrice td
{
border-bottom: 1px solid #ccc;
color: gray;
font-size: 13px;
padding: 6px 8px;
}
</style>
<body>
<div class="catalogPriceWrapper">
<table class="catalogPrice">
<thead>
<tr>
<th scope="col"></th>
<th scope="col"></th>
<th scope="col">Overall Size</th>
<th scope="col">Printable</th>
<th scope="col">Retail Price Goes Underneath This Long Line here. </th>
</tr>
<tr>
<th scope="col">Description</th>
<th scope="col">Style No.</th>
<th scope="col">(WxH)</th>
<th scope="col">Area</th>
<th scope="col">1</th>
<th scope="col">2-24</th>
<th scope="col">25-99</th>
<th scope="col">100+</th>
</tr>
</thead>
<tbody>
<tr>
<td>Product Name</td>
<td>ABCDE</td>
<td>6'' x 8'' x 2 1½''</td>
<td>2 ¾'' x 5''</td>
<td>$74.50</td>
<td>$68.02</td>
<td>$67.59</td>
<td>$66.94 <strong>(P)</strong></td>
</tr>
</tbody>
</table>
</div>
</body>
</html>