Inserting new <TD> elements into a table row.

Posted by Hunter S. Smythe on Stack Overflow See other posts from Stack Overflow or by Hunter S. Smythe
Published on 2010-05-15T04:16:40Z Indexed on 2010/05/15 4:24 UTC
Read the original article Hit count: 389

Filed under:
|
|
|

I have created a small application written in XHTML, JavaScript/JQuery and PHP.

The PHP reads and writes to a small SQLite database.

How would i go about inserting cells into a pre-scripted table. The cells would need to be configured using some information from my database. For example, below are two cells with their data retrieved from my database:

Cell One
Starts: 120px;
Finishes: 180px;
Background: Blue;

Cell Two
Starts: 240px;
Finishes: 300px;
Background: Green;

On my table row, it is 500px in width. How would I insert the cells above into the row. In this example, the first cell would start 120px into the row and have a width of 180px. The second cell would start 240px into the row and have a width of 300px.

I just cant seem to work out a way of doing this, any ideas would be very helpful.

Thank you for any input, all is appreciated. Hunter.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about table