[英]Export list to excel using jquery
我正在嘗試將動態列表導出到excel / notepad / notepad ++ / word。 我看到了將表格導出到excel的方法,但這不能解決我的問題。 我的無序列表包含多個列表(可更改),並且我要導出的值是來自text(value_to_export)類型的輸入的值。 如何導出所有這些列表值? 謝謝?
<ul>
<li id="0" class="list">
<input type="checkbox" class="" id="" value="">
<input type="text" id="" title="" class="" value="value_to_export">
</li>
</ul>
您可以使用HTML表代替li。
table2excel是一個簡單而有用的jQuery插件,它允許將HTML表格數據導出到Excel文件。
< script src = "//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" > < /script> <script src="src/jquery.table2excel.js "></script>
<button>Export</button>
$("button").click(function(){ $("#table2excel").table2excel({ // exclude CSS class exclude: ".noExl", name: "Excel Document Name" }); });
<tr class="noExl"> <th>#</th> <th>Column heading</th> <th>Column heading</th> <th>Column heading</th> </tr>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.