我用了
<script type="text/javascript">
function exportExcel() {
var sHtml = htmlEncode($("#mystamp")[0].outerHTML);//做html编码
$("input[name='hHtml']").val(sHtml);
//表单提交
$("form[name='myForm']").submit();
}
function htmlEncode(value) {
//create a in-memory div, set it's inner text(which jQuery automatically encodes)
//then grab the encoded contents back out. The div never exists on the page.
return $('<div/>').text(value).html();
}
</script> 这种方式生成word,但是生成出来的没有样式,求助啊!!!
一只萌萌小番薯