The solution? The mso-number-format style attribute, to be put on table cells (<td>). Several number formats are available. These are some of the more common:
mso-number-format:\@
text
mso-number-format:"0\.000"
3 decimals
mso-number-format:\#\,\#\#0\.000
comma separators (and 3 decimals)
mso-number-format:"mm\/dd\/yy"
Date format
mso-number-format:"d\\-mmm\\-yyyy"
another date format
mso-number-format
ercent
percent
'mso' stands for Microsoft Office, so these formatting hints will hold if table data is imported into any Office product.
To solve our initial problem -- not dropping leading zeros from account numbers, we used the text format in a CSS style sheet:
td.accountnum
{mso-number-format:\@}
Then, on the the actual table, just use the accountnum class:
<td class="accountnum">01070000<td>
Partager