Así es como logré leer una tabla en javascript. Básicamente profundicé en las filas y luego pude profundizar en las celdas individuales para cada fila. Esto debe darle una idea
//gets table
var oTable = document.getElementById('myTable');
//gets rows of table
var rowLength = oTable.rows.length;
//loops through rows
for (i = 0; i < rowLength; i++){
//gets cells of current row
var oCells = oTable.rows.item(i).cells;
//gets amount of cells of current row
var cellLength = oCells.length;
//loops through each cell in current row
for(var j = 0; j < cellLength; j++){
/* get your cell info here */
/* var cellVal = oCells.item(j).innerHTML; */
}
}
ACTUALIZADO - PROBADOS SCRIPT
<table id="myTable">
<tr>
<td>A1</td>
<td>A2</td>
<td>A3</td>
</tr>
<tr>
<td>B1</td>
<td>B2</td>
<td>B3</td>
</tr>
</table>
<script>
//gets table
var oTable = document.getElementById('myTable');
//gets rows of table
var rowLength = oTable.rows.length;
//loops through rows
for (i = 0; i < rowLength; i++){
//gets cells of current row
var oCells = oTable.rows.item(i).cells;
//gets amount of cells of current row
var cellLength = oCells.length;
//loops through each cell in current row
for(var j = 0; j < cellLength; j++){
// get your cell info here
var cellVal = oCells.item(j).innerHTML;
alert(cellVal);
}
}
</script>
He progresado con el fragmento. innerHTML parece estar vacío, lo cual es extraño porque así es como agregué los datos cuando ingresé los datos en mi código de JavaScript. var cell4 = row.insertCell (3); cell4.innerHTML = límite; – MrM
cell4.innerHTML = limit; ¿Qué es el límite? Creo que si asigna una variable a cell4.innerHTML, obtendrá lo que está en esa celda (suponiendo que configure todo correctamente y que haya datos reales). – webdad3
OK Acabo de crear una página de prueba y probé el guión. Edité mi respuesta original para alertar a cada una de las celdas de la mesa. Desde aquí, creo que deberías poder obtener lo que estás necesitando. – webdad3