"Simple Grid"
Bootstrap 3.0.0 Snippet by bootsnip

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
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<div class="container">
<div class="row">
<h2>simple GRID</h2>
</div>
<div class="row">
<h3 class="text-center text-primary">Persons</h3>
<div class="col-md-12">
<table class="table table-hover" id="worked">
<thead>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Email</th>
<th>Telephone</th>
<th>
<button type="button" class="btn btn-blue add-row">+</button></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<input class="form-control" type="text"></td>
<td>
<input class="form-control" type="text"></td>
<td>
<input class="form-control" type="text"></td>
<td>
<input class="form-control" type="text"></td>
<td>
<button type="button" class="btn btn-danger delete-row">-</button></td>
</tr>
<tr>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
$(function () {
$('#worked .add-row').click(function () {
var template = '<tr><td><input class="form-control" type="text"></td><td><input class="form-control" type="text"></td><td><input class="form-control" type="text"></td><td><input class="form-control" type="text"></td><td><button type="button" class="btn btn-danger delete-row">-</button></td></tr>';
$('#worked tbody').append(template);
});
$('#worked').on('click', '.delete-row', function () {
$(this).parent().parent().remove();
});
})
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments:

test

kjjh () - 8 years ago - Reply 0