Skip to content

Commit 3a34b50

Browse files
committed
🎨 Fixed header in contest table (#1874)
1 parent 803f683 commit 3a34b50

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/lib/components/TaskTables/TaskTable.svelte

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,12 @@
129129
</Heading>
130130

131131
<!-- TODO: ページネーションを実装 -->
132-
<!-- TODO: ヘッダーを固定できるようにする。-->
133-
<!-- HACK: Flowbite と tailwindcss の相性が悪いのかもしれない。tailwindcss のクラス指定、raw HTML & CSS を試したが、いずれも実現できず。 -->
134132
<!-- See: -->
135133
<!-- https://github.com/kenkoooo/AtCoderProblems/blob/master/atcoder-problems-frontend/src/pages/TablePage/AtCoderRegularTable.tsx -->
136134
<!-- https://github.com/birdou/atcoder-blogs/blob/main/app/atcoder-blogs-frontend/src/pages/BlogTablePage/BlogTablePage.tsx -->
137135
<!-- https://tailwindcss.com/docs/position#sticky-positioning-elements -->
138-
<div class="container w-full overflow-hidden rounded-md border shadow-sm">
139-
<div class="w-full overflow-auto">
136+
<div class="container w-full rounded-md border shadow-sm">
137+
<div class="w-full sticky top-0 z-20 border-b">
140138
<Table id="task-table" class="text-md table-fixed w-full" aria-label="Task table">
141139
<TableHead class="text-sm bg-gray-100">
142140
<TableHeadCell class="w-full xl:w-16 px-2 text-center" scope="col">Round</TableHeadCell>
@@ -149,7 +147,11 @@
149147
{/each}
150148
{/if}
151149
</TableHead>
150+
</Table>
151+
</div>
152152

153+
<div class="w-full overflow-auto max-h-[calc(80vh-56px)]">
154+
<Table id="task-table" class="text-md table-fixed w-full" aria-label="Task table">
153155
<TableBody class="divide-y">
154156
{#if contestIds.length && taskTableHeaderIds.length}
155157
{#each contestIds as contestId}

0 commit comments

Comments
 (0)