我有測驗結果表格,表格中有等級單元格。顯示錶格單元格的平均值和總和
實施例(細胞級是在while循環和數字與如果檢查其他細胞後出現):
<table border="1">
<tbody>
<tr>
<th> id </th>
<th> question </th>
<th> answer </th>
<th> correct answer </th>
<th> grade </th>
</tr>
<tr>
<td> 1 </td>
<td> question how bla bla bla</td>
<td> bla bla answer</td>
<td> correct answer</td>
<td> 5 (this cell has the grade of each question)</td>
</tr>
<tr>
<td> 2 </td>
<td> question2 how bla bla bla</td>
<td> bla bla answer2</td>
<td> correct answer2</td>
<td> 8 (this cell has the grade of each question)</td>
</tr>
等
// in this cell i want to show me the average from td grade
<td colspan="4" align="center">average</td>
<td><input type="text" readonly="readonly" name="Avg" /></td>
</tbody>
</table>
非常感謝!!
的問題不明確。什麼是你的HTML結構和你試圖獲取單元格數據的JavaScript代碼是什麼? – halilb
我在表格單元格中有一些數字,我想在其他兩個單元格中顯示這些數字的平均值和數量。我是新的,我不知道如何用JavaScript做到這一點..例如的名稱是級顯示我在一個單元格中的細胞等級數的計數 –
請編輯問題併發布實際的HTML,而不僅僅是一個描述。 – Archer