jquery - Clone a tr, but preserve width -


i'm trying clone row in table, , insert row empty table. easy.

but possible preserve original width of cells in tr (that may perhaps expanded due other cells in same column)?

edit realized should iterate through matching cells after clone , sync width. still curious if there more direct way though...

clone row, iterate on children of row, setting width of each child each child of original @ corresponding index.

var target = $('#target'); var target_children = target.children();  var clone = target.clone();  clone.children().width(function(i,val) {     return target_children.eq(i).width(); });  $('<table>',{border:1}).append(clone).appendto('body'); 

example: http://jsfiddle.net/z7hwh/

i'm unsure of browser support setting width on <td>.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -