building dynamic tables cells and specifying colspan

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • rsd

    #1

    building dynamic tables cells and specifying colspan

    how do you specify the "colspan" attribut of a <td> cell when building
    the table/rows/cells dynamicly?

    ie: lets say we have the follwoing code:

    table = document.all["resTable"];
    // header row
    tr1 = table.insertRow ();
    td1 = tr1.insertCell( );
    td1.innerHTML = "this is the header row";
    // data row
    tr2 = table.insertRow ();
    td1 = tr2.insertCell( )
    td1.innerHTML = "column one";
    td2 = tr2.insertCell( );
    td2.innerHTML = "column two";
    td3 = tr2.insertCell( );
    td3.innerHTML = "column three";

    for the 1st row's only cell, how would you specify the colspan for the
    cell?
    normal in HTML it would be <td colspan=3>. i can specify different
    atributes by using "td1.height ", "td1.style.back ground", ect, but
    "td.colspan =3" just doesnt work.

    also, this will only be used with ie browsers, thanks for any help,

    rsd
  • Richard Cornford

    #2
    Re: building dynamic tables cells and specifying colspan

    "rsd" <rsdebold@yahoo .com> wrote in message
    news:63faf5da.0 307071859.f2201 48@posting.goog le.com...
    <snip>[color=blue]
    > table = document.all["resTable"];[/color]
    <snip>[color=blue]
    > ... ect, but
    > "td.colspan =3" just doesnt work.[/color]

    td.colSpan = 3;

    The S of Span should be upper case.

    Richard.


    Comment

    Working...