<script type="text/javascript">
function excelPrint() { var tempStr = document.getElementById('cardlistxls').outerHTML; var strOut = getStyle() + tempStr; var winSave = window.open(); winSave.document.open("application/vnd.ms-excel", ""); winSave.document.write(strOut); winSave.document.close(); winSave.document.execCommand("SaveAs", true, "card.html"); winSave.window.close(); } function getStyle() { var Style = '<style>TB{BACKGROUND-COLOR: black;FONT-SIZE: 12px;LINE-HEIGHT: 16px;TEXT-DECORATION: none;} td{mso-number-format:"\@";BACKGROUND-COLOR:white} td.top{BACKGROUND-COLOR: #4F93DC;COLOR: #ffffff;FONT-SIZE: 12px; LINE-HEIGHT: 16px; TEXT-DECORATION: none;}</style>'; return Style; } </script> |
|
来自: 悟静 > 《.net和asp.net》