Click to See Complete Forum and Search --> : Tables in Javascript


Burrow
04-21-2003, 05:01 PM
How do you write tables within javascript?

I know it's possible to write out each script like so:

<Table width="" border="1">
<TR>
<TD>

Somehting

</TD>
<TD>

<script>
(some action)
</script>
</TD>
</TR>
</TABLE>

I know that is possible but that is a lot of needless writing.
Is there anyway that I can just write one witin javascript.
I can't just write it using a document.write(ln)(<table>...);

Or can I and I'm just missing something.

Thanks.

Jona
04-21-2003, 05:09 PM
Not sure if I understand you completely..

<script>
document.write("<table><tr><td>Your stuff</td></tr></table>");
</script>

pyro
04-21-2003, 05:10 PM
Yes, javascript can write tables. Try it using this:

document.write('<table width="100" border="1"><tr><td>test</td></tr></table>');

Burrow
04-21-2003, 06:27 PM
Oh, so I was just looking too hard for an answer that was right in front of me. :)

Thanks.