分享你我的心得.
共乘一片美好网络.

导出excel格式

下面是格式具体代码,导出这样的代码就可以是excel格式,和正常导出单纯web代码为excel格式的时候不一样的地方为其他地方都是excel表格,而web代码格式的excel除表格外,外部为白色

对比一下就知道了!但也是伪excel格式。

伪excel格式代码如下(存为xls后缀格式):

<html xmlns:o=”urn:schemas-microsoft-com:office:office” xmlns:x=”urn:schemas-microsoft-com:office:excel” xmlns=”http://www.w3.org/TR/REC-html40″><meta http-equiv=”content-type” content=”application/vnd.ms-excel; charset=UTF-8″><head><!–[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>Sheet0</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]–></head><body><table><tr><td>This Should get exported as a header</td><td>This should too</td></tr><tr><td>data1a with a link one and link two.</td><td>data1b with a image.</td></tr><tr><td>data2a with a text value.</td><td>data2b with a second text value.</td></tr><tr><td>This footer spans 2 cells</td></tr></table></body></html>

赞(0)
未经允许不得转载:小叶白龙博客 » 导出excel格式
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址