开发者

Chrome, table columns don't align after editing row with jQuery

开发者 https://www.devze.com 2023-01-30 13:36 出处:网络
I\'ve cleared a row and then added new cells using jQuery.This works fine in Firefox, but the columns don\'t align correctly in google Chrome.I\'ve included a picture that uses Google Chrome\'s debugg

I've cleared a row and then added new cells using jQuery. This works fine in Firefox, but the columns don't align correctly in google Chrome. I've included a picture that uses Google Chrome's debugger to demonstrate what I'm talking about:

Chrome, table columns don't align after editing row with jQuery

And this is the code:

// clear old contents
row.empty();
row.inputs={};
// write new cells
for( var i=0; i<this.fields.length; i++){
    var field = this.fields[i];
    var newCell = $('<td></td>');
    row.append(newC开发者_开发问答ell);
    var newInput = $('<input></input>');
    newCell.append(newInput);
    row.inputs[field.name] = newInput;
    newInput.val(row.representedObject[field.name]);
}


http://api.jquery.com/remove/

Removes not only the markup but the DOM reference as well. Might solve your problem, as well as any possible problems related to the DOM.

0

精彩评论

暂无评论...
验证码 换一张
取 消