
December 24, 2011
June 24, 2011
January 24, 2011
December 19, 2010
June 2, 2010
April 22, 2010
April 2, 2010
April 1, 2010
March 30, 2010
February 12, 2010
February 4, 2010
January 29, 2010
April 1, 2010
When I design printed materials, most of the time the dimensions I’m given are in fractions. I thought I would create a table of decimal conversions to refer to.
The formula for converting inches to decimals is:
Take the first number in the fraction and divide it by the second number in the fraction.
1 unit ÷ 16 units = 0.0625
1 unit ÷ 8 units = 0.125
| Inches in 1/16 | Decimals | |
|---|---|---|
| 1/16 | 0.0625 | |
| 2/16 | 1/8 | 0.125 |
| 3/16 | 0.1875 | |
| 4/16 | 1/4 | 0.25 |
| 5/16 | 0.3125 | |
| 6/16 | 3/8 | 0.375 |
| 7/16 | 0.4375 | |
| 8/16 | 1/2 | 0.5 |
| 9/16 | 0.5625 | |
| 10/16 | 5/8 | 0.625 |
| 11/16 | 0.6875 | |
| 12/16 | 2/3 | 0.75 |
| 13/16 | 0.8125 | |
| 14/16 | 7/8 | 0.875 |
| 15/16 | 0.9375 | |
| 16/16 | 1 | 1.0 |
As I was working on this table, I was curious if there was a way provided by CSS or HTML that allowed alignment of table cells by decimal point or charactor.
According to the W3C, there is an character alignment attribute called char, but it is not widely supported. Besides, the align attribute is deprecated anyway. If a browser doesn’t support character alignment, behavior in the presence of the char value is unspecified.
<table> <colgroup></colgroup> <col><col align="char" char="."> <tr> <th>vegetable</th><th>cost per pound</th></tr> <tr> <td>lettuce</td><td>$2.50</td></tr> <tr> <td>carrots</td><td>$3.50</td></tr> <table> Also, the text-align property could contain a “string” character, but that was scrapped in CSS 2.1 due to limited browser support.
td {text-align: "."; /* Not supported */}That seems strange to me, since tables are for storing data, that there is no easy way provided by the HTML language to align on decimal.
