-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
126 lines (110 loc) · 2.62 KB
/
index.html
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<!DOCTYPE html>
<html>
<head>
<title>Table</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<center>
<div class="display">
<div class="head">
<h1>Displaying User Information</h1>
</div>
<div class="content">
<h4>Entering the Details</h4>
<table border="4">
<thead>
<tr>
<th>First Name</th>
<td><input type="text" name="fname" id="fname"></td>
</tr>
</thead>
<tbody>
<tr>
<th>Last Name</th>
<td><input type="text" name="lname" id="lname"></td>
</tr>
<tr>
<th>Email</th>
<td><input type="text" name="email" id="email"></td>
</tr>
<tr>
<th>Age</th>
<td><input type="text" name="age" id="age"></td>
</tr>
<tr>
<th>course</th>
<td><input type="text" name="course" id="course"></td>
</tr>
<tr>
<th>ph</th>
<td><input type="text" name="ph" id="ph"></td>
</tr>
<tr>
<th>Address</th>
<td><input type="text" name="address" id="address"></td>
</tr>
<tr id="btna">
<td colspan="2"><input type="button" name="button" id="btn" value="Add" onclick="AddRow()"></td>
</tr>
</tbody>
</table>
</div>
<div class="process">
<h4>User information</h4>
<table border="4" id="show">
<thead>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Email</th>
<th>Age</th>
<th>Course</th>
<th>ph</th>
<th>Address</th>
</tr>
</thead>
</table>
</div>
</div>
</center>
<script>
var list1 = [];
var list2 = [];
var list3 = [];
var list4 = [];
var list5 = [];
var list6 = [];
var list7 = [];
var n = 1;
var x = 0;
function AddRow(){
var AddRown = document.getElementById('show');
var NewRow = AddRown.insertRow(n);
list1[x] = document.getElementById("fname").value;
list2[x] = document.getElementById("lname").value;
list3[x] = document.getElementById("email").value;
list4[x] = document.getElementById("age").value;
list5[x] = document.getElementById("course").value;
list6[x] = document.getElementById("ph").value;
list7[x] = document.getElementById("address").value;
var cel1 = NewRow.insertCell(0);
var cel2 = NewRow.insertCell(1);
var cel3 = NewRow.insertCell(2);
var cel4 = NewRow.insertCell(3);
var cel5 = NewRow.insertCell(4);
var cel6 = NewRow.insertCell(5);
var cel7 = NewRow.insertCell(6);
cel1.innerHTML = list1[x];
cel2.innerHTML = list2[x];
cel3.innerHTML = list3[x];
cel4.innerHTML = list4[x];
cel5.innerHTML = list5[x];
cel6.innerHTML = list6[x];
cel7.innerHTML = list7[x];
n++;
x++;
}
</script>
</body>
</html>