[Javascript] RES: (no subject)

SosCpdGMail soscpd at gmail.com
Mon Aug 27 17:14:23 CDT 2007


Document.write do the job, but write the tr/tr with the td's. Will be a
little monster like:

<table>
<tr>
<td>whatever</td>
<td>whatever</td>
</tr>
<script>
Document.write("<tr><td>whatever</td><td>whatever</td></tr>");
</script>
</table>

That really works. You can use the document.createElement too. I use this
second one.



-----Mensagem original-----
De: javascript-bounces at lists.evolt.org
[mailto:javascript-bounces at lists.evolt.org] Em nome de Hassan Schroeder
Enviada em: segunda-feira, 27 de agosto de 2007 19:58
Para: JavaScript List
Assunto: Re: [Javascript] (no subject)

lists at jdpill.com wrote:

> That being the case, if I want to insert two rows into the table, using
> javascript, how could I do that within the bounds of valid HTML? One of
> two code options is inserted by the js - one option having one row, the
> second having two...? by inserting two rows (which will have rows before
> and after), I'm going to have to have the div overlapping the cells and
> rows at some point?

The point is you shouldn't be using a DIV here at all; it doesn't
belong in a table.

Either insert your innerHTML into a TR, or insert an entire row
into a TBODY, which is probably better if you have a situation of
possible multiple row insertions.

Or add it via DOM and skip the innerHTML entirely... :-)

-- 
Hassan Schroeder ----------------------------- hassan at webtuitive.com
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com

                            dream.  code.

_______________________________________________
Javascript mailing list
Javascript at lists.evolt.org
http://lists.evolt.org/mailman/listinfo/javascript




More information about the Javascript mailing list