【发布时间】:2016-03-16 01:48:26
【问题描述】:
我正在使用 EPPlus 库从 DataTable 生成 Excel。
我正在修改用于循环遍历数据表和创建电子表格的代码。
用于设置单元格样式的代码如下:
td.Attributes.Add("style", @"mso-number-format:\@");
我有以下逻辑:
for (int row = 6; row <= totalRow; row++)
{
for (int col = 1; col <= 9; col++)
{
string colVol = (string)ws.Cells[row, col].Value;
bool isNumeric = long.TryParse(colVol, out n);
if (isNumeric && colVol.Length > 10)
{
ws.Cells[row, col] //need to assign css style here
}
}
}
我需要使用 EPPlus 做同样的事情。
这可能吗?
【问题讨论】: