将HTML导出到Word文档时,特定页面的背景颜色是否可能不同?我想在首页上创建一个背景为蓝色的文档,而在随后的所有页面上都只将背景设置为白色。
我通过这样设置内容类型将HTML导出到Word:
go.Histogram()
HTML标头:
Response.AppendHeader("Content-Type", "application/vnd.ms-word")
Response.AppendHeader("Content-disposition", "attachment;filename=Rapport.doc")
在正文中添加表以使内容按我想要的方式对齐。
ExportHeader &= "<html>"
ExportHeader &= "<head>"
ExportHeader &= "<style>"
ExportHeader &= "html,body,th,td { font-family:Verdana,Arial; font-size:9pt; }"
ExportHeader &= "body { background-color: #1c3f94; } "
ExportHeader &= "h3 { font-size:12pt; }"
ExportHeader &= "</style>"
ExportHeader &= "</head>"
ExportHeader &= "<body>"
页脚:
ExportBody &= "<table>"
ExportBody &= "<tr><td>First blue background</td></tr>"
ExportBody &= "</table>"
ExportBody &= "<br clear=all style='mso-special-character:line-break;page-break-before:always' />"
ExportBody &= "<table>"
ExportBody &= "<tr><td>Second page, white background</td></tr>"
ExportBody &= "</table>"
我想要实现的目标: