Graeme06
Technical User
- Jun 6, 2006
- 60
Hi, I'm not sure exactly where to place this since it sort of spans HTML, CSS, Javascript, and PHP; but since AJAX is basically based around Javascript, I'll try here:
So my problem is that I want to use AJAX to update cells of a table. Basically I have a table with 15 columns and 3 rows. What I want to do is update a single row of a table, excluding the first cell, so what I did was some code like
<tr>
<td>cell1</td>
<div id="row1">
<td>cell2</td>
(repeat 13 more times for cells 3 - 15)
</div>
</tr>
So then to change these cells, I use AJAX to set the innerHTML of the div "row1" to
<td>cell2 new data</td>
(repeat for remaining 13cells)
However, this doesn't work. It places the code above the table. Is there a better way I can dynamically update cells of a table without completely rewriting the table?
Thanks,
Graeme
So my problem is that I want to use AJAX to update cells of a table. Basically I have a table with 15 columns and 3 rows. What I want to do is update a single row of a table, excluding the first cell, so what I did was some code like
<tr>
<td>cell1</td>
<div id="row1">
<td>cell2</td>
(repeat 13 more times for cells 3 - 15)
</div>
</tr>
So then to change these cells, I use AJAX to set the innerHTML of the div "row1" to
<td>cell2 new data</td>
(repeat for remaining 13cells)
However, this doesn't work. It places the code above the table. Is there a better way I can dynamically update cells of a table without completely rewriting the table?
Thanks,
Graeme