1 頁 (共 1 頁)

如何在使用者端建立Excel表格

發表於 : 2008年 11月 27日, 13:59
tim
在 html 的 head 中加入
ContentType: application/vnd.ms-excel 即可!!
以下為 asp 程式的範例:

代碼: 選擇全部

     
    <%@ Language=VBScript %> 
    <%Response.ContentType = "application/vnd.ms-excel"%> 
    <TABLE> 
    <TR> 
    <TH>Col 1</TD> 
    <TH>Col 2</TD> 
    <TH>Total</TD> 
    </TR> 
    <TR> 
    <TD>1</TD> 
    <TD>2</TD> 
    <TD><FONT color=#000080>=sum(a2:b2)</FONT></TD> 
    </TR> 
    <TR> 
    <TD>4</TD> 
    <TD>6</TD> 
    <TD><FONT color=#000080>=sum(a3:b3)</FONT></TD> 
    </TR> 
    </TABLE>