Chrome, table columns don't align after editing row with jQuery
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:
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.
精彩评论