-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtableDOM.html
More file actions
44 lines (44 loc) · 828 Bytes
/
tableDOM.html
File metadata and controls
44 lines (44 loc) · 828 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<!DOCTYPE html>
<html>
<head>
<script>
function myfunc()
{
var b=document.getElementById("demo");
var row=b.insertRow(3);
var cell1=row.insertCell(0);
var cell2=row.insertCell(1);
var cell3=row.insertCell(2);
cell1.innerHTML="ajay";
cell2.innerHTML=16;
cell3.innerHTML="btech";
}
function myfunc1()
{
var b=document.getElementById("demo");
b.deleteRow(3);
}
</script>
</head>
<body>
<table align="center" id="demo" height="500px" width="500px" border="1px">
<th>Name</th>
<th>Age</th>
<th>Qualification</th>
<tr id="demo1">
<td>anshul</td>
<td>13</td>
<td>Btech</td>
</tr>
<tr>
<td>riya</td>
<td>14</td>
<td>BA</td>
</tr>
</table>
<form>
<input type="button" value="insert row" onclick="myfunc()">
<input type="button" value="delete row" onclick="myfunc1()">
</form>
</body>
</html>