导出 Excel 时候,设置数字单元格以字符串形式导出

技术分享 2019-10-01 00:00:00
当单元格是数值时,如:100000000000000000000,导出的Excel显示的是科学计数法,那如何转换成字符串呢?请下以下方法:
在样式表里添加:

.style0
{mso-number-format:General;
text-align:general;
vertical-align:bottom;
white-space:nowrap;
mso-rotate:0;
mso-background-source:auto;
mso-pattern:auto;
color:windowtext;
font-size:12.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:宋体;
mso-generic-font-family:auto;
mso-font-charset:134;
border:none;
mso-protection:locked visible;
mso-style-name:常规;
mso-style-id:0;}
td{mso-style-parent:style0; mso-number-format:"\@"; }



主要是:mso-number-format:"\@"; //设置其数值为默认字符串
咨询小瓶科技
咨询我们
顶部