Karen Nelson
06-14-2006, 11:51 AM
Hi,
I am trying to format fractions using css and tables. Each side of the fraction has both a number and units (like, 2.54 cm / 1 in). I would like to use the border-bottom property to create the fraction bar. However, if I apply the class to the entire row, I get no border, and if I apply the class to the individual cells, I get a small break in the fraction bar.
Secondly, I put a gray background behind the units, but the gray reaches all the way to the fraction bar on the top (but not bottom) of the fraction. I would prefer to have a small separation in each case.
If anyone can help fix these problems, I would really appreciate it!
-Karen.
<html>
<head>
<style type="text/css">
<!--
.frTop td{border-bottom: 1px solid #000000;
border-collapse:collapse;
padding-bottom:2;}
.frBottom td {
padding-top:2;}
.units {background-color:#CCCCCC;}
-->
</style>
</head>
<body>
<table width="10%">
<tr class="frTop"><td >2.54</td><td class="units">cm</td></tr>
<tr class="frBottom"><td>1</td><td class="units">in</td></tr>
</table>
</body>
</html>
I am trying to format fractions using css and tables. Each side of the fraction has both a number and units (like, 2.54 cm / 1 in). I would like to use the border-bottom property to create the fraction bar. However, if I apply the class to the entire row, I get no border, and if I apply the class to the individual cells, I get a small break in the fraction bar.
Secondly, I put a gray background behind the units, but the gray reaches all the way to the fraction bar on the top (but not bottom) of the fraction. I would prefer to have a small separation in each case.
If anyone can help fix these problems, I would really appreciate it!
-Karen.
<html>
<head>
<style type="text/css">
<!--
.frTop td{border-bottom: 1px solid #000000;
border-collapse:collapse;
padding-bottom:2;}
.frBottom td {
padding-top:2;}
.units {background-color:#CCCCCC;}
-->
</style>
</head>
<body>
<table width="10%">
<tr class="frTop"><td >2.54</td><td class="units">cm</td></tr>
<tr class="frBottom"><td>1</td><td class="units">in</td></tr>
</table>
</body>
</html>