x
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
<div class="flow-root" id="users" data-controller="table">
<div class="overflow-x-auto">
<div class="inline-block min-w-full align-middle">
<table class="table-auto min-w-full divide-y divide-gray-300">
<thead class="sticky top-0 bg-white">
<tr>
<th class="px-3 py-4 text-left text-sm font-semibold text-gray-900 scope="col" > # </th>
<th class="px-3 py-4 text-left text-sm font-semibold text-gray-900 scope="col" > Name </th>
<th class="px-3 py-4 text-left text-sm font-semibold text-gray-900 text-right scope="col" > Email </th>
</tr>
<tbody class="divide-y divide-gray-200">
<tr class="group" >
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500" data-table-target="division">
1
</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500" data-table-target="division">
Alice
</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500 text-right" data-table-target="division">
alice@example.com
</td>
</tr>
<tr class="group" >
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500" data-table-target="division">
2
</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500" data-table-target="division">
Bob
</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500 text-right" data-table-target="division">
bob@example.com
</td>
</tr>
<tr class="group" >
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500" data-table-target="division">
3
</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500" data-table-target="division">
Charlie
</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500 text-right" data-table-target="division">
charlie@example.com
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
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
<%# slim
= render Vitrail::Table.new(id: "users", data: { controller: "table" }) do |table|
= table.with_header.with_content("id")
= table.with_header.with_content("name")
= table.with_header(class: "text-right").with_content("email")
- users.each do |user|
- table.with_row(td: { data: { table_target: "division" } }) do |row|
= row.with_division.with_content(user.id)
= row.with_division.with_content(user.name)
= row.with_division(class: "text-right").with_content(user.email)
%>
<%= render Vitrail::Table.new(id: "users", data: { controller: "table" }) do |table| %>
<%= table.with_header.with_content("#") %>
<%= table.with_header.with_content("Name") %>
<%= table.with_header(class: "text-right").with_content("Email") %>
<% users.each do |user| %>
<% table.with_row(td: { data: { table_target: "division" } }) do |row| %>
<%= row.with_division.with_content(user.id) %>
<%= row.with_division.with_content(user.name) %>
<%= row.with_division(class: "text-right").with_content(user.email) %>
<% end %>
<% end %>
<% end %>