views:

63

answers:

3

I know that JQuery is a very powerful library and was just wondering if it had the following capability that I really need.

Lets say I need to insert new cells into a table row, I know how to do this basic task, but I need to insert my cells in a highly unusual way due to some of the requirements that are needed for the new cells.

I need to be able to insert cells a certain distance into the row, For example, if a row was 1000pixels wide, is there a feature in JQuery that would allow me to insert the cell 250pixels into the row and have a cell width of 50pixels and insert another cell 500pixels into the row with a cell width of 100pixels. I know how to set a cells width using JQuery, just not distance into a row.

The values wont ever be the exact same as above though because they are actually read from a database, so for example, one cell would have the following values:

CELL_01
$start=100;
$finish=150;

the above would mean a new cell is needed that needs to be inserted 100pixels into the row and has a width of 50pixels, I just cant seem to find a way to implement this feature into my application.

How could I accomplish this task?

Sorry for such a strange question, but i just cant seem to get this working.
Thanks!

+2  A: 

You can emulate this by having a single column table (or the equivalent in terms of nested divs), and then use CSS relative positioning to put more divs into the rows at offsets you like.

I don't think you can do it with td, as these are bound to fixed column widths.

Tomalak
Good answer! I was stuck on trying to think of how in the world you could have two rows with differently sized columns without a megaton of colspan craziness. Sometimes the easy way is so elusive...
BradBrening
Thank you for this, it is a very good idea!I can construct the <div>'s and then insert them between the <td></td>.
Michael Smith
Please mark this answer as accepted if it was helpful.
BradBrening
A: 

Don't really understand what the main question is here. But from my take of it, looks like you are trying to create a Datagrid. Since you are using JQuery I recommend take a look at this library: http://plugins.jquery.com/project/jqGrids. As for the customization of tables (as in the HTML tag), this is going to drive you nuts.

Rsyntax
A: 

Are you looking for something like this plugin called jLayout?

fudgey