sudhaoncyberworld@gmail.com wrote:[color=blue]
> Pl excuse me if my question is silly
>
> var tbl=document.createElement('TABLE');
> var tr=tbl.insertRow();[/color]
insertRow requires an argument that is the index at which to insert
the row. An index of -1 will insert the row at the end (effectively
at rows.length).
<URL:http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-39872903>
[color=blue]
> tr.id='tr1';
> tr.style.borderWidth='thin';
> tr.style.borderStyle='ridge';
> tr.style.borderColor='blue';
> var td=tr.insertCell();[/color]
The same advice goes applies to insertCell.
<URL:http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-68927016>
[color=blue]
> var txt=document.createTextNode('ABC1');
> td.appendChild(txt);
> var td=tr.insertCell();
> var txt=document.createTextNode('ABC2');
> td.appendChild(txt);
> var tr=tbl.insertRow();
> tr.id='tr2';
> tr.style.borderStyle='none';
> var td=tr.insertCell();
> var txt=document.createTextNode('ABC3');
> td.appendChild(txt);
> var td=tr.insertCell();
> var txt=document.createTextNode('ABC4');
> td.appendChild(txt);
> document.body.appendChild(tbl);
>
> Why i am not able to assign border for particular row[/color]
That will be better answered in a CSS forum, see the discussion here:
<URL:
http://groups.google.com/group/comp....b2b2935467fd4c[color=blue]
>[/color]
--
Rob