🐛 courses table overflow and clipped actions column - table.tsx: drop Table's own scroll wrapper
Browse files at this commitd231127727c80a057e66227e0597f163d08dc8a8Parent: 267d95d- fix
- 🐛 courses table overflow and clipped actions column - table.tsx: drop Table's own scroll wrapper
- DataTableFrame is the single overflow container (nested scrollbars rendered inside table border) - courses-page: colgroup term 9rem, creator 10rem, actions 5rem
- min-w 56rem -> 44rem (fits without horizontal scroll) - css: data-table th overflow-hidden text-ellipsis so header text never paints past its column
3 changed files +10 -10
- src/components/ui/table.tsx +5 -5
- src/index.css +1 -1
- src/pages/courses-page.tsx +4 -4
src/components/ui/table.tsxmodified+5 -5
| @@ -2,14 +2,14 @@ import type { ComponentProps, ParentProps } from "solid-js"; | |||
| 2 | import { splitProps } from "solid-js"; | 2 | import { splitProps } from "solid-js"; |
| 3 | import { cn } from "@/lib/cn"; | 3 | import { cn } from "@/lib/cn"; |
| 4 | 4 | ||
| 5 | +// No scroll wrapper here: every Table sits inside DataTableFrame, which is the | ||
| 6 | +// single overflow container — a second one nests scrollbars inside the border. | ||
| 5 | export function Table(props: ParentProps<ComponentProps<"table">>) { | 7 | export function Table(props: ParentProps<ComponentProps<"table">>) { |
| 6 | const [local, rest] = splitProps(props, ["class", "children"]); | 8 | const [local, rest] = splitProps(props, ["class", "children"]); |
| 7 | return ( | 9 | return ( |
| 8 | - <div class="relative w-full overflow-auto rounded-lg border border-border/70"> | 10 | + <table class={cn("w-full caption-bottom text-sm", local.class)} {...rest}> |
| 9 | - <table class={cn("w-full caption-bottom text-sm", local.class)} {...rest}> | 11 | + {local.children} |
| 10 | - {local.children} | 12 | + </table> |
| 11 | - </table> | ||
| 12 | - </div> | ||
| 13 | ); | 13 | ); |
| 14 | } | 14 | } |
| 15 | 15 | ||
src/index.cssmodified+1 -1
| @@ -141,7 +141,7 @@ | |||
| 141 | } | 141 | } |
| 142 | 142 | ||
| 143 | .data-table th { | 143 | .data-table th { |
| 144 | - @apply h-9 whitespace-nowrap border-r border-border/60 px-3 text-left text-[11px] font-semibold uppercase tracking-[0.08em] last:border-r-0; | 144 | + @apply h-9 overflow-hidden text-ellipsis whitespace-nowrap border-r border-border/60 px-3 text-left text-[11px] font-semibold uppercase tracking-[0.08em] last:border-r-0; |
| 145 | } | 145 | } |
| 146 | 146 | ||
| 147 | .data-table td { | 147 | .data-table td { |
src/pages/courses-page.tsxmodified+4 -4
| @@ -227,13 +227,13 @@ function CoursesContent() { | |||
| 227 | </div> | 227 | </div> |
| 228 | </div> | 228 | </div> |
| 229 | <DataTableFrame> | 229 | <DataTableFrame> |
| 230 | - <Table class="data-table table-fixed min-w-[56rem]"> | 230 | + <Table class="data-table table-fixed min-w-[44rem]"> |
| 231 | <colgroup> | 231 | <colgroup> |
| 232 | <col class="w-[28%]" /> | 232 | <col class="w-[28%]" /> |
| 233 | <col class="w-[30%]" /> | 233 | <col class="w-[30%]" /> |
| 234 | - <col class="w-[14rem]" /> | 234 | + <col class="w-[9rem]" /> |
| 235 | - <col class="w-[11rem]" /> | 235 | + <col class="w-[10rem]" /> |
| 236 | - <col class="w-[3.5rem]" /> | 236 | + <col class="w-[5rem]" /> |
| 237 | </colgroup> | 237 | </colgroup> |
| 238 | <TableHeader> | 238 | <TableHeader> |
| 239 | <TableRow> | 239 | <TableRow> |