<table cellspacing="0" cellpadding="0" width="200px" id="colors">
</table>
var colors = ['red', 'green', 'blue', 'orange', 'black'], tds = '';
for(i=0; i<colors.length; i++) tds += '<tr><td>'+colors[i]+'</td><td width="100px" bgcolor="'+colors[i]+'"></td></tr>';
document.getElementById('colors').innerHTML = '<tbody>'+tds+'</tbody>';