...

View Full Version : Changing the text within a table cell?



ggallen
03-18-2004, 08:10 PM
for instance:

<table id="test" width=100% border=0>
<tr>
<td>col1</td><td>col2</td>
</tr>
</table>

OK.

So with the above the word "col1" is in column 1
and "col2" is in column 2.

Is there anyway using JS to replace the word col1
to something else?

Thanks

Antoniohawk
03-18-2004, 08:31 PM
<table id="test" width=100% border=0>
<tr>
<td id="cell1">col1</td><td>col2</td>
</tr>
</table>

document.getElementById('cell1').innerHTML = 'Whatever you want in the table cell.';

ggallen
03-18-2004, 08:34 PM
thanks.

I didn't want to ID the spots I want to change.....
but that's probably the easiest and cleanest way.

George



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum