Previews

No matching results.

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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<div class="max-w-4xl mx-auto p-6">
<h2 class="text-xl font-bold mb-4">Bordered Table</h2>
<div class="shadow-sm ring-1 ring-primary-300 sm:rounded-lg overflow-x-auto">
<table class="min-w-full divide-y divide-primary-300">
<thead class="bg-primary-50 text-primary-900">
<tr class="">
<th class="px-3 py-3.5 text-sm font-semibold align-middle text-left first:ps-4 first:pe-3 sm:first:ps-6 last:ps-3 last:pe-4 sm:last:pe-6" scope="col" >
Product
</th>
<th class="px-3 py-3.5 text-sm font-semibold align-middle text-left first:ps-4 first:pe-3 sm:first:ps-6 last:ps-3 last:pe-4 sm:last:pe-6" scope="col" >
Category
</th>
<th class="px-3 py-3.5 text-sm font-semibold align-middle text-right first:ps-4 first:pe-3 sm:first:ps-6 last:ps-3 last:pe-4 sm:last:pe-6" scope="col" >
Price
</th>
<th class="px-3 py-3.5 text-sm font-semibold align-middle text-center first:ps-4 first:pe-3 sm:first:ps-6 last:ps-3 last:pe-4 sm:last:pe-6" scope="col" >
Stock
</th>
</tr>
</thead>
<tbody class="divide-y divide-primary-200 bg-white">
<tr class="">
<td class="px-3 py-4 text-sm text-black align-middle text-left first:ps-4 first:pe-3 sm:first:ps-6 last:ps-3 last:pe-4 sm:last:pe-6" >
Widget A
</td>
<td class="px-3 py-4 text-sm text-black align-middle text-left first:ps-4 first:pe-3 sm:first:ps-6 last:ps-3 last:pe-4 sm:last:pe-6" >
Electronics
</td>
<td class="px-3 py-4 text-sm text-black align-middle text-right first:ps-4 first:pe-3 sm:first:ps-6 last:ps-3 last:pe-4 sm:last:pe-6" >
$29.99
</td>
<td class="px-3 py-4 text-sm text-black align-middle text-center first:ps-4 first:pe-3 sm:first:ps-6 last:ps-3 last:pe-4 sm:last:pe-6" >
150
</td>
</tr>
<tr class="">
<td class="px-3 py-4 text-sm text-black align-middle text-left first:ps-4 first:pe-3 sm:first:ps-6 last:ps-3 last:pe-4 sm:last:pe-6" >
Widget B
</td>
<td class="px-3 py-4 text-sm text-black align-middle text-left first:ps-4 first:pe-3 sm:first:ps-6 last:ps-3 last:pe-4 sm:last:pe-6" >
Hardware
</td>
<td class="px-3 py-4 text-sm text-black align-middle text-right first:ps-4 first:pe-3 sm:first:ps-6 last:ps-3 last:pe-4 sm:last:pe-6" >
$49.99
</td>
<td class="px-3 py-4 text-sm text-black align-middle text-center first:ps-4 first:pe-3 sm:first:ps-6 last:ps-3 last:pe-4 sm:last:pe-6" >
75
</td>
</tr>
<tr class="">
<td class="px-3 py-4 text-sm text-black align-middle text-left first:ps-4 first:pe-3 sm:first:ps-6 last:ps-3 last:pe-4 sm:last:pe-6" >
Widget C
</td>
<td class="px-3 py-4 text-sm text-black align-middle text-left first:ps-4 first:pe-3 sm:first:ps-6 last:ps-3 last:pe-4 sm:last:pe-6" >
Software
</td>
<td class="px-3 py-4 text-sm text-black align-middle text-right first:ps-4 first:pe-3 sm:first:ps-6 last:ps-3 last:pe-4 sm:last:pe-6" >
$9.99
</td>
<td class="px-3 py-4 text-sm text-black align-middle text-center first:ps-4 first:pe-3 sm:first:ps-6 last:ps-3 last:pe-4 sm:last:pe-6" >
</td>
</tr>
</tbody>
</table>
</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
27
28
29
30
31
32
33
<div class="max-w-4xl mx-auto p-6">
<h2 class="text-xl font-bold mb-4">Bordered Table</h2>
<%= render BetterUi::Table::TableComponent.new(variant: :primary, style: :bordered) do |t| %>
<% t.with_header do |h| %>
<% h.with_cell(label: "Product") %>
<% h.with_cell(label: "Category") %>
<% h.with_cell(label: "Price", align: :right) %>
<% h.with_cell(label: "Stock", align: :center) %>
<% end %>
<% t.with_row do |r| %>
<% r.with_cell { "Widget A" } %>
<% r.with_cell { "Electronics" } %>
<% r.with_cell(align: :right) { "$29.99" } %>
<% r.with_cell(align: :center) { "150" } %>
<% end %>
<% t.with_row do |r| %>
<% r.with_cell { "Widget B" } %>
<% r.with_cell { "Hardware" } %>
<% r.with_cell(align: :right) { "$49.99" } %>
<% r.with_cell(align: :center) { "75" } %>
<% end %>
<% t.with_row do |r| %>
<% r.with_cell { "Widget C" } %>
<% r.with_cell { "Software" } %>
<% r.with_cell(align: :right) { "$9.99" } %>
<% r.with_cell(align: :center) { "∞" } %>
<% end %>
<% end %>
</div>