-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtable.html
72 lines (61 loc) · 1.86 KB
/
table.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
<html>
<head>
<!-- Remember to include jQuery :) -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="ResponsiveTable.css">
<script>
function createtable()
{
$('#eachTable').html("");
var rows = $('#rows').val();
if(rows=="")
{
alert("Please Select Number.");
$('#eachTable').html("");
return;
}
var eTable = '<div class="wrapper">';
eTable += '<div class="table">';
eTable += '<div class="row header green">'
+'<div class="cell">Name</div>'
+'<div class="cell">Age</div>'
+'<div class="cell">Gender</div>'
+'<div class="cell">Dob</div>'
+'<div class="cell">Action</div>'
+'</div>';
for(var sl=1; sl<=rows; sl++)
{
eTable += '<div class="row">';
eTable += '<div class="cell" data-title="Name"><input type="text"/></div>';
eTable += '<div class="cell" data-title="Age"><input type="number"/></div>';
eTable += '<div class="cell" data-title="Gender"><select id="gender" name="gender">'
+'<option>Select</option>'
+'<option>Male</option>'
+'<option>Female</option>'
+'</select></div>';
eTable += '<div class="cell" data-title="Dob"><input type="date" name="dob" id="dob"/></div>';
eTable += '<div class="cell" data-title="Action"><input type="submit" name="btnsubmit" id="btnsubmit" value="Click Here" class="btn btn-danger"/></div>';
eTable += '</div>';
}
eTable += "</div></div>";
$('#eachTable').html(eTable);
}
</script>
</head>
<body class="bodyclass">
How many row:-
<select id="rows" onchange="createtable()">
<option>Select</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
</select>
<br/><br/>
<div id="eachTable"></div>
</body>
<script src="jquery.min.js"></script>
</html>