"Tables Styles"
Bootstrap 3.3.0 Snippet by MTaqi

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="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.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">
<h1>CSS only Responsive Tables</h1>
<h2>Basic overflow:</h2>
<table class="table table-hove rtable">
<thead>
<tr>
<th>Browser</th>
<th>Sessions</th>
<th>Percentage</td>
<th>New Users</th>
<th>Avg. Duration</th>
</tr>
</thead>
<tbody>
<tr>
<td>Chrome</td>
<td>9,562</td>
<td>68.81%</td>
<td>7,895</td>
<td>01:07</td>
</tr>
<tr>
<td>Firefox</td>
<td>2,403</td>
<td>17.29%</td>
<td>2,046</td>
<td>00:59</td>
</tr>
<tr>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
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
.rtable {
display: inline-block;
vertical-align: top;
max-width: 100%;
overflow-x: auto;
white-space: nowrap;
border-collapse: collapse;
border-spacing: 0;
}
.rtable,
.rtable--flip tbody {
-webkit-overflow-scrolling: touch;
background: -webkit-radial-gradient(left ellipse, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0) 75%) 0 center, -webkit-radial-gradient(right ellipse, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0) 75%) 100% center;
background: radial-gradient(ellipse at left, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0) 75%) 0 center, radial-gradient(ellipse at right, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0) 75%) 100% center;
background-size: 10px 100%, 10px 100%;
background-attachment: scroll, scroll;
background-repeat: no-repeat;
}
.rtable td:first-child,
.rtable--flip tbody tr:first-child {
background-image: -webkit-linear-gradient(left, white 50%, rgba(255, 255, 255, 0) 100%);
background-image: linear-gradient(to right, white 50%, rgba(255, 255, 255, 0) 100%);
background-repeat: no-repeat;
background-size: 20px 100%;
}
.rtable td:last-child,
.rtable--flip tbody tr:last-child {
background-image: -webkit-linear-gradient(right, white 50%, rgba(255, 255, 255, 0) 100%);
background-image: linear-gradient(to left, white 50%, rgba(255, 255, 255, 0) 100%);
background-repeat: no-repeat;
background-position: 100% 0;
background-size: 20px 100%;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: