forked from saucelabs/the-internet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtables.erb
142 lines (140 loc) · 4.19 KB
/
tables.erb
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<script src="/js/vendor/jquery.tablesorter.min.js"></script>
<script>
$(function(){
$("#table1").tablesorter();
$("#table2").tablesorter();
});
</script>
<style>
span {
padding-right: 20px;
background-repeat: no-repeat;
background-position: 100% 100%;
}
.tablesorter-headerAsc span { background-image: url('img/down-arrow.png'); }
.tablesorter-headerDesc span { background-image: url('img/up-arrow.png'); }
</style>
<div class="example">
<h3>Data Tables</h3>
<p>Often times when you see a table it contains data which is sortable -- sometimes with actions that can be taken within each row (e.g. edit, delete). And it can be challenging to automate interaction with sets of data in a table depending on how it is constructed.</p>
<h4>Example 1</h4>
<p>No Class or ID attributes to signify groupings of rows and columns</p>
<table id="table1" class="tablesorter">
<thead>
<tr>
<th><span>Last Name</span></th>
<th><span>First Name</span></th>
<th><span>Email</span></th>
<th><span>Due</span></th>
<th><span>Web Site</span></th>
<th><span>Action</span></th>
</tr>
</thead>
<tbody>
<tr>
<td>Smith</td>
<td>John</td>
<td>[email protected]</td>
<td>$50.00</td>
<td>http://www.jsmith.com</td>
<td>
<a href='#edit'>edit</a>
<a href='#delete'>delete</a>
</td>
</tr>
<tr>
<td>Bach</td>
<td>Frank</td>
<td>[email protected]</td>
<td>$51.00</td>
<td>http://www.frank.com</td>
<td>
<a href='#edit'>edit</a>
<a href='#delete'>delete</a>
</td>
</tr>
<tr>
<td>Doe</td>
<td>Jason</td>
<td>[email protected]</td>
<td>$100.00</td>
<td>http://www.jdoe.com</td>
<td>
<a href='#edit'>edit</a>
<a href='#delete'>delete</a>
</td>
</tr>
<tr>
<td>Conway</td>
<td>Tim</td>
<td>[email protected]</td>
<td>$50.00</td>
<td>http://www.timconway.com</td>
<td>
<a href='#edit'>edit</a>
<a href='#delete'>delete</a>
</td>
</tr>
</tbody>
</table>
<h4>Example 2</h4>
<p>Class and ID attributes to signify groupings of rows and columns</p>
<table id="table2" class="tablesorter">
<thead>
<tr>
<th><span class='last-name'>Last Name</span></th>
<th><span class='first-name'>First Name</span></th>
<th><span class='email'>Email</span></th>
<th><span class='dues'>Due</span></th>
<th><span class='web-site'>Web Site</span></th>
<th><span class='action'>Action</span></th>
</tr>
</thead>
<tbody>
<tr>
<td class='last-name'>Smith</td>
<td class='first-name'>John</td>
<td class='email'>[email protected]</td>
<td class='dues'>$50.00</td>
<td class='web-site'>http://www.jsmith.com</td>
<td class='action'>
<a href='#edit'>edit</a>
<a href='#delete'>delete</a>
</td>
</tr>
<tr>
<td class='last-name'>Bach</td>
<td class='first-name'>Frank</td>
<td class='email'>[email protected]</td>
<td class='dues'>$51.00</td>
<td class='web-site'>http://www.frank.com</td>
<td class='action'>
<a href='#edit'>edit</a>
<a href='#delete'>delete</a>
</td>
</tr>
<tr>
<td class='last-name'>Doe</td>
<td class='first-name'>Jason</td>
<td class='email'>[email protected]</td>
<td class='dues'>$100.00</td>
<td class='web-site'>http://www.jdoe.com</td>
<td class='action'>
<a href='#edit'>edit</a>
<a href='#delete'>delete</a>
</td>
</tr>
<tr>
<td class='last-name'>Conway</td>
<td class='first-name'>Tim</td>
<td class='email'>[email protected]</td>
<td class='dues'>$50.00</td>
<td class='web-site'>http://www.timconway.com</td>
<td class='action'>
<a href='#edit'>edit</a>
<a href='#delete'>delete</a>
</td>
</tr>
</tbody>
</table>
</div>