I need collect data from the HTML table and send it to the server. I must use JQuery.
there is my table
<table id="table" border=1>
<thead> <tr>
<th>First</th>
<th>Last</th>
<th>Date of birth</th>
<th>City</th>
</tr></thead>
<tbody>
<tr>
<td>TEXT1</td>
<td>TEXT2</td>
<td>TEXT3</td>
<td>TEXT4</td>
</tr>
<tr>
<td>TEXT5</td>
<td>TEXT6</td>
<td>TEXT7</td>
<td>TEXT8</td>
</tr>
<tr>
<td>TEXT9</td>
<td>TEXT10</td>
<td>TEXT11</td>
<td>TEXT12</td>
</tr>
</tbody>
</table>
You could achieve it in this manner,
First we select all the data from the table cell’s and then we send it to the server side via jquery ajax
JQuery Code:
Html code:
in your server side PHP Code (here i am sending back what has been posted to server, just for the example)