F
Falc2199
i all,
I have an HTML table within which I have a span. When the user
clicks a button I want to update the contents of this span with form
elements table elements (TR,TD).
The problem is that if I do not wrap the span tag inside a TR
and TD, it is not properly placed in the table and the update does not
work at all. However if I do place the span inside a TR and TD, the TR
and TD which was supposed to go into the span is not becoming properly
aligned because now I have nested TR and TDs.
Anyone have any thougts, here is some sample code....
function repeatQuestion(divHtml, divId) {
var elem = document.getElementById(divId);
elem.innerHTML = divHtml; // divHtml contains TD and TRs
}
<table>
<span id="divId"></span> // this does not work
<tr><td><span id="divId"></span></td></tr> // this works but format
messed up
<input type=button onClick=repeatQuestion(divHtml,divId)>
</table>
Thanks in advance,
Jehan
I have an HTML table within which I have a span. When the user
clicks a button I want to update the contents of this span with form
elements table elements (TR,TD).
The problem is that if I do not wrap the span tag inside a TR
and TD, it is not properly placed in the table and the update does not
work at all. However if I do place the span inside a TR and TD, the TR
and TD which was supposed to go into the span is not becoming properly
aligned because now I have nested TR and TDs.
Anyone have any thougts, here is some sample code....
function repeatQuestion(divHtml, divId) {
var elem = document.getElementById(divId);
elem.innerHTML = divHtml; // divHtml contains TD and TRs
}
<table>
<span id="divId"></span> // this does not work
<tr><td><span id="divId"></span></td></tr> // this works but format
messed up
<input type=button onClick=repeatQuestion(divHtml,divId)>
</table>
Thanks in advance,
Jehan