以下为问题截图-右边多余部分是空白
.
2.以下为解决之后截图-边上为线形
代码如下html添加如下属性
<html xmlns:v=\'urn:schemas-microsoft-com:vml\' xmlns:o=\'urn:schemas-microsoft-com:office: office\'xmlns: x =\'urn:schemas-microsoft-com:office:excel\' xmlns = \'http://www.w3.org/TR/REC-html40\' >
sb.Append("<head>");
//解决空白剩余显示 在head标签上添加temp变量代码,
string temp = @" <!--[if gte mso 9]><xml>
<x:ExcelWorkbook>
<x:ExcelWorksheets>
<x:ExcelWorksheet>
<x:Name></x:Name>
<x:WorksheetOptions>
<x:Selected/>
</x:WorksheetOptions>
</x:ExcelWorksheet>
</x:ExcelWorksheets>
</x:ExcelWorkbook>
</xml><![endif]-->";
sb.Append(temp);
</head>
代码截图如下