【发布时间】:2013-05-24 02:16:50
【问题描述】:
此代码将下载表格中的 html 文件:我从这里得到它:http://www.kunalbabre.com/projects/table2CSV.php
<form action="getcsv.php" method ="post" >
<input type="hidden" name="csv_text" id="csv_text"/>
<input type="submit" value="Get CSV File" onclick="getCSVData()">
</form>
<script>
function getCSVData(){
var csv_value=$('#example1').table2CSV({delivery:'value'});
//$("#csv_text").val(csv_value);
}
</script>
getcsv.php:
<?php
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"my-data.csv\"");
$data=stripcslashes($_REQUEST['csv_text']);
echo $data;
?>
但是,我提取的表格是分页的。 我只能得到第一页。 如何在 csv 中包含表中的所有数据?
分页表如下所示:
<div id="paging_container8">
<div class="page_navigation">
</div>
<table id="my-table">
<tr style="display: table-row;">
<tr style="display: table-row;">
<tr style="display: none;"> // next page (paginated)
<tr style="display: none;"> //next page (paginated)
</table>
<div class="page_navigation">
</div>
<br>
</div>
【问题讨论】:
标签: php javascript html pagination