When you save a file as Hypertext Markup Language (HTML)
and view it in a Web browser, numbers formatted with currency symbols may not
have their decimal points lined up correctly. In Excel, the decimal points are
lined up correctly.
↑ Back to the top
This problem may occur if all of the following conditions
are true:
- You format the numbers with the Accounting format, which
aligns the currency symbol on the left and the number portion on the right of
each cell.
- You save the file as a static or noninteractive HTML
file.
This problem occurs because HTML has no method to both left
align and right align text in the same cell.
↑ Back to the top
To work around this problem, use either of the following
methods:
- Use the Currency number format instead of Accounting. The
Currency format aligns the numbers to the right without aligning the currency
symbols.
- Publish the file as a Web page with
interactivity.
To publish a file as a Web page with interactivity, follow
these steps:
- Open the worksheet you want to put on a Web
page.
- On the File menu, click Save as Web Page.
- In the Save As dialog box, click Publish.
- In the Publish as Web Page dialog box,
under Viewing options, click to select the Add
interactivity with check box.
- If you want to view the Web page in your browser after you
publish it, click to select the Open published web page in
browser check box.
- Click Publish.
↑ Back to the top
When you use the Accounting format, Microsoft Excel aligns
decimal points. Excel first draws the number as right-aligned, and then draws
the currency symbol and spaces as left-aligned. In this way, both the currency
symbols and decimal points are aligned vertically. There is no way in HTML to
have the browser do the same thing. In a browser, numbers with Accounting
format are left aligned, and because the width of space characters is not
always the same as the width of digits, decimal places may be
misaligned.
This is not a problem when you publish with
interactivity, because the browser uses the Microsoft Office Spreadsheet
Component, which is able to format and display the Accounting format in the
same way as the spreadsheet.
↑ Back to the top