<html> <head> </head> <body> <table> <tr> <td>1</td> <td style="mso-number-format:'/@';">10000000000001</td> <td style="mso-number-format:'0/.00';">111111111111111</td> </tr> <tr> <td>1</td> <td>10000000000001</td> <td>11111111111111111111</td> </tr> </table> </body> </html>
主要是 <td style="mso-number-format:'/@';"> 起作用
其他自定义单元格格式 样式
| mso-number-format:"0" | no decimals |
| mso-number-format:"0/.000" | 3 decimals |
| mso-number-format:"/#/,/#/#0/.000" | comma with 3 dec |
| mso-number-format:"mm//dd//yy" | date7 |
| mso-number-format:"mmmm/ d/,/ yyyy" | date9 |
| mso-number-format:"m//d//yy/ h/:mm/ am//pm" | d -t ampm |
| mso-number-format:"short date" | 01/03/1998 |
| mso-number-format:"medium date" | 01-mar-98 |
| mso-number-format:"d/-mmm/-yyyy" | 01-mar-1998 |
| mso-number-format:"short time" | 5:16 |
| mso-number-format:"medium time" | 5:16 am |
| mso-number-format:"long time" | 5:16:21:00 |
| mso-number-format:"percent" | percent - two decimals |
| mso-number-format:"0%" | percent - no decimals |
| mso-number-format:"0/.e+00" | scientific notation |
| mso-number-format:"/@" | text |
| mso-number-format:"/#/ ???//???" | fractions - up to 3 digits (312/943) |
| mso-number-format:"/0022£/0022/#/,/#/#0/.00" | £12.76 |
| mso-number-format:"/#/,/#/#0/.00_ /;/[red/]/-/#/,/#/#0/.00/ " |
2 decimals, negative numbers in red and signed |
本文介绍了HTML中表格的应用及如何使用自定义单元格格式来显示数据。详细列举了多种mso-number-format属性的用法,包括数值、日期、时间等格式的设置。

1702

被折叠的 条评论
为什么被折叠?



