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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<div class="max-w-4xl mx-auto p-6"> <h2 class="text-xl font-bold mb-4">Table with Footer</h2> <div class="shadow-sm ring-1 ring-black/5 sm:rounded-lg overflow-x-auto"> <table class="min-w-full divide-y divide-primary-300"> <caption class="px-3 py-4 text-sm text-grayscale-500 caption-bottom text-left">Quarterly Sales Report</caption> <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" > Quarter </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" > Revenue </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" > Expenses </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" > Profit </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" > Q1 2024 </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" > $150,000 </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" > $90,000 </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" > $60,000 </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" > Q2 2024 </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" > $175,000 </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" > $95,000 </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" > $80,000 </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" > Q3 2024 </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" > $200,000 </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" > $110,000 </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" > $90,000 </td> </tr> </tbody> <tfoot class="border-t border-grayscale-200"> <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" > Total </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" > $525,000 </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" > $295,000 </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" > $230,000 </td> </tr> </tfoot> </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
34
35
36
37
38
39
40
<div class="max-w-4xl mx-auto p-6"> <h2 class="text-xl font-bold mb-4">Table with Footer</h2> <%= render BetterUi::Table::TableComponent.new(variant: :primary, caption: "Quarterly Sales Report") do |t| %> <% t.with_header do |h| %> <% h.with_cell(label: "Quarter") %> <% h.with_cell(label: "Revenue", align: :right) %> <% h.with_cell(label: "Expenses", align: :right) %> <% h.with_cell(label: "Profit", align: :right) %> <% end %> <% t.with_row do |r| %> <% r.with_cell { "Q1 2024" } %> <% r.with_cell(align: :right) { "$150,000" } %> <% r.with_cell(align: :right) { "$90,000" } %> <% r.with_cell(align: :right) { "$60,000" } %> <% end %> <% t.with_row do |r| %> <% r.with_cell { "Q2 2024" } %> <% r.with_cell(align: :right) { "$175,000" } %> <% r.with_cell(align: :right) { "$95,000" } %> <% r.with_cell(align: :right) { "$80,000" } %> <% end %> <% t.with_row do |r| %> <% r.with_cell { "Q3 2024" } %> <% r.with_cell(align: :right) { "$200,000" } %> <% r.with_cell(align: :right) { "$110,000" } %> <% r.with_cell(align: :right) { "$90,000" } %> <% end %> <% t.with_footer_row do |r| %> <% r.with_cell { "Total" } %> <% r.with_cell(align: :right) { "$525,000" } %> <% r.with_cell(align: :right) { "$295,000" } %> <% r.with_cell(align: :right) { "$230,000" } %> <% end %> <% end %></div>No notes provided.
No params configured.