求轉出EXCLE技術
<SCRIPT LANGUAGE="javascript">
function table2xls()
{
function String.prototype.Trim()
{return this.replace(/(^\s*)|(\s*$)/g,"");}
try
{
var e = document.getElementById("Table1");
var s = "";
for (var j=0; j<e.rows.length; j++)
{
if (e.rows[0].cells[0].innerText.Trim() == "")
{
for (var i=1; i<e.rows[j].cells.length; i++)
s += e.rows[j].cells[i].innerText.Trim() +"\t";
}
else
{
for (var i=0; i<e.rows[j].cells.length; i++)
s += e.rows[j].cells[i].innerText.Trim() +"\t";
}
s += "\r\n";
}
var xlsWindow =
window.open("","_blank","left=-1,top=-1,width=100,height=100");
xlsWindow.document.write(s);
xlsWindow.document.close();
//alert(xlsWindow.document.body.innerHTML);
xlsWindow.document.execCommand('Saveas',true,'%homeDrive%\\Report.xls')
xlsWindow.close();
}catch(e){}
}
</script>
上面的代碼可以正常的轉出EXCLE文件,但我想要轉出的文件的字體的大小為9的話應該怎樣寫呢?