May 29, 2002
cellspacing and the DOM
By the way, if you’re using the DOM to generate TABLE elements, you have to use setAttribute() to set the cellspacing and avoid the 2-pixel default spacing given to the table. Oh, and IE5.x stupidly requires that the cellspacing attribute be defined in camelCase: cellSpacing.
var tbl = document.createElement("TABLE");
tbl.setAttribute("cellSpacing","0");
Luckily this works in Mozilla too, so you don’t have fork your code for each browser.












