In that piece of code I go through the table the body and each td and to each cell I assign the color and try to assign the id of each cell (td) but all it does is repeat the last id of the last cell.
$(function () {
$("#materiales tbody tr").each(function (index){
$(this).children("td").each(function (index2){
$(".cuadro").css("background-color", "#ECF8E0");
$(".cuadro").text( $(this).attr("id") );
})
})
})
Someone to help me solve it