【发布时间】:2016-11-09 17:56:59
【问题描述】:
我在 asp 中有一个创建 xls 表的页面,但是当打开表时,所有行都填充到我想要设置的默认列宽中。
我的桌子看起来像这样:
<table>
<thead>
'A for loop makes a series of th
</thead>
'another loop pulls db values
<tr><td>value1</td><td>value2</td> 'etc </tr>
</table>
我尝试了以下设置空间
- width="3.29in"
- &nsp;垃圾邮件(野蛮但有时有效)
- width="400px"
- style="width:300px"
上述方法似乎都不起作用。
另外这里是我的标题 asp 以防它的相关
Response.Clear()
Response.Buffer = False
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", "attachment; filename=blah.xls"
由于某种原因,当我印有美元价值时,也附注
<td>$<%=dbvalue%></td>
由于某种原因,这会产生 '$dollar 价值,我不确定如何取消单引号。
【问题讨论】:
-
如果您不使用“th”系列并将它们保留为“td”会发生什么?您可以将 td 的样式添加为 font-weight
标签: excel asp-classic formatting html-table