Pages

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
<div class="overflow-auto">
<table class="text-left text-base w-full" data-testid="demo-table-table">
<caption class="sr-only">Demo table</caption>
<thead>
<tr class="border-b border-subdued">
<th class="font-semibold px-2 py-3" scope="col">
Name
</th>
<th class="font-semibold px-2 py-3" scope="col">
ID
</th>
</tr>
</thead>
<tbody>
<tr class="border-b border-subdued hover:bg-neutral hover:cursor-pointer" data-testid="tr-1">
<td class="relative px-2 py-3" style="" data-testid="tr-1-td-0"><a class="underline hover:no-underline focus:no-underline text-accent hover:text-accent-hover relative z-10" href="#a_link/">Name 1</a><a aria-hidden="true" class="absolute inset-0" tabindex="-1" href="#a_link/"></a></td>
<td class="relative px-2 py-3" style="" data-testid="tr-1-td-1"><span class="relative z-10">1</span><a aria-hidden="true" class="absolute inset-0" tabindex="-1" href="#a_link/"></a></td>
</tr>
<tr class="border-b border-subdued hover:bg-neutral hover:cursor-pointer" data-testid="tr-2">
<td class="relative px-2 py-3" style="" data-testid="tr-2-td-0"><a class="underline hover:no-underline focus:no-underline text-accent hover:text-accent-hover relative z-10" href="#a_link/">Name 2</a><a aria-hidden="true" class="absolute inset-0" tabindex="-1" href="#a_link/"></a></td>
<td class="relative px-2 py-3" style="" data-testid="tr-2-td-1"><span class="relative z-10">2</span><a aria-hidden="true" class="absolute inset-0" tabindex="-1" href="#a_link/"></a></td>
</tr>
<tr class="border-b border-subdued hover:bg-neutral hover:cursor-pointer" data-testid="tr-3">
<td class="relative px-2 py-3" style="" data-testid="tr-3-td-0"><a class="underline hover:no-underline focus:no-underline text-accent hover:text-accent-hover relative z-10" href="#a_link/">Name 3</a><a aria-hidden="true" class="absolute inset-0" tabindex="-1" href="#a_link/"></a></td>
<td class="relative px-2 py-3" style="" data-testid="tr-3-td-1"><span class="relative z-10">3</span><a aria-hidden="true" class="absolute inset-0" tabindex="-1" href="#a_link/"></a></td>
</tr>
<tr class="border-b border-subdued hover:bg-neutral hover:cursor-pointer" data-testid="tr-4">
<td class="relative px-2 py-3" style="" data-testid="tr-4-td-0"><a class="underline hover:no-underline focus:no-underline text-accent hover:text-accent-hover relative z-10" href="#a_link/">Name 4</a><a aria-hidden="true" class="absolute inset-0" tabindex="-1" href="#a_link/"></a></td>
<td class="relative px-2 py-3" style="" data-testid="tr-4-td-1"><span class="relative z-10">4</span><a aria-hidden="true" class="absolute inset-0" tabindex="-1" href="#a_link/"></a></td>
</tr>
</tbody>
</table>
</div>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{ "/sort/#{data.id}" },
sortable: false
)
anchor_table(
data:,
caption:,
condensed:,
paginate:,
rows_link_to: ->(_) { rows_link_to },
sort_url:,
sortable:
) do |table|
table.with_column(header: "Name", value: -> { it.name.capitalize })
table.with_column(header: "ID", value: :id)
end
Param Description Input