I build dynamically my HTML table from database like that: for (i = 0; i < nomCols.length; i++) { retour.append((\"<td bgcolor=#0066CC>\") + nomCols[i] + \"</td>\");