Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating <td> with colspan attributes

Status
Not open for further replies.

Foamcow

Programmer
Nov 14, 2002
6,092
GB
I'm creating a table in which each row represents an event booking.

When the user clicks a row then I am dynamically creating a row beneath the clicked row and using Ajax to pull in more data about that booking.

This is all working fine but I can't seem to create the new <td> elements with a suitable colspan attribute.

For example, I have 5 columns.
My new <tr> contains 2 <td> elements, the first should span 3 columns and the second span 2 columns.
When I create the elements they, obviously, only span a single column.
Setting an attribute for the <td> doesn't seem to work.
I'm going to continue pursuing this avenue as I think it should work so maybe my error is elsewhere, but if anyone can point me in the right direction I'd be most grateful.



<honk>*:O)</honk>

Tyres: Mine's a pint of the black stuff.
Mike: You can't drink a pint of Bovril.
 
In typical fashion 10 seconds after posting the question I noticed an error in my code.

The setAttribute method does work.
duh

I should give myself a star :)

<honk>*:O)</honk>

Tyres: Mine's a pint of the black stuff.
Mike: You can't drink a pint of Bovril.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top