【发布时间】:2023-03-09 00:57:01
【问题描述】:
我需要创建一个 html 脚本来创建联系人表并使用 jQuery。我正在尝试下载此 html 页面并将其转换为 excel 文件。
谁能帮帮我??
我有这个html文件
contact.html
<div id="dv">
<table id="tblExport" style="border:1px solid black; ">
<thead>
<tr>
<th>#</th>
<th>First Name</th>
<th>Last Name</th>
<th>Username</th>
</tr>
</thead>
<tbody>
<tr>
<td style='background-color:red;'>1</td>
<td>Mark</td>
<td>Otto</td>
<td>@mdo</td>
</tr>
<tr>
<td>2</td>
<td>Jacob</td>
<td>Thornton</td>
<td>@fat</td>
</tr>
<tr>
<td>3</td>
<td>Larry</td>
<td>the Bird</td>
<td>@twitter</td>
</tr>
</tbody>
</table>
</div>
<div>
<button id="btnExport">Export to excel</button>
</div>
</div>
那么如何使用jQuery让按钮下载这个表格并进行转换 到excel表格??
【问题讨论】:
标签: jquery html jquery-click-event