I tried different solutions to extract data from table to xls, jquery standart methonds, plugins etc. But it does not work. I think the problem is in table structure. All plugins extract data from clean HTML tables, but my table gets data from php, so maybe this is the reason of the problem? How can I extract data to xls from this table:
<table cellspacing="1" id="table-exp" class="tablesorter">
<thead>
<tr>
<th>Маршрут</th>
<th>Идентификатор</th>
<th>Дата</th>
<th>Время в минутах</th>
<th>Время в секундах</th>
<th>Средняя скорость</th>
<th>Расстояние</th>
<th>Стоимость топлива</th>
</tr>
</thead>
<?php
$result = mysql_query("SELECT * FROM trackdata ORDER BY `dateC` DESC");
if (!$result) {
echo 'Could not run query: ' . mysql_error();
exit;
}
echo "<tbody>";
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)){
echo "<tr>";
echo "<td>",$row["trackID"],"</td>";
echo "<td>",$row["uuid"],"</td>";
echo "<td>",$row["dateC"],"</td>";
echo "<td>",$row["timeInMinutes"],"</td>";
echo "<td>",$row["timeInSeconds"],"</td>";
echo "<td>",$row["averageSpeed"],"</td>";
echo "<td>",$row["distance"],"</td>";
echo "<td>",round($row["distance"] * 1.2, 2)," грн</td>";
echo "</tr>";
}
echo "</tbody>";
mysql_free_result($result);
?>
<tfoot>
<tr>
<th>Маршрут</th>
<th>Идентификатор</th>
<th>Дата</th>
<th>Время в минутах</th>
<th>Время в секундах</th>
<th>Средняя скорость</th>
<th>Расстояние</th>
<th>Стоимость топлива</th>
</tr>
</tfoot>
</table>
I think jquery plugins cannot parse such table because of php code part. How to deal with it? How to extract data in this case?