以下のコードに新しいカラムを追加するにはどうすればいいですか: テーブルIDまたはtr idまたはtd idがない場合は、これが必要です。テーブルIDを持たないHTMLテーブルに新しいカラムを追加
チェックして、あなたはアクセス用のテーブルをgetElementsByTagName
を使用することができます私に
<p>Click the button to insert new cell(s) at the beginning of the table row.</p>
<table>
<tr>
<td>First cell</td>
<td>Second cell</td>
<td>Third cell</td>
</tr>
</table><br>
<button onclick="myFunction()">Try it</button>
<script>
function myFunction() {
var row = ??????????????
var x = row.insertCell(0);
x.innerHTML = "New cell";
}
</script>
だからあなただけのIDなしIDなし、またはIDのない任意のTRに、または任意のTDに任意のテーブルへの参照を取得したいですか?その例では、そのテーブルのすべての要素になります - そうですか? – Whothehellisthat