<table>
<tr>
<td class="sel">1</td><td>2</td><td class="sel">3</td>
</tr>
</table>
<script>
var cells = document.querySelectorAll('.sel');
for(var i = 0; i < cells.length; i++){
var d = document.createElement("div");
d.style = "width:100px;height:100px;background-color: red;";
cells[i].appendChild(d);
}
</script>