⬅️ keep table values left-aligned over leftover centering
Browse files at this commitbb77bbccb8b102717cdfc14e9625a4501c02734aParent: d037143- fix
- ⬅️ keep table values left-aligned over leftover centering
2 changed files +6 -2
src/components/ui/data-table.tsxmodified+5 -1
| @@ -620,11 +620,15 @@ export function DataTable<TData, TValue = unknown>(props: DataTableProps<TData, | |||
| 620 | return ( | 620 | return ( |
| 621 | <TableCell | 621 | <TableCell |
| 622 | class={cn( | 622 | class={cn( |
| 623 | - alignClass[alignOf(cell.column)], | ||
| 624 | leftCellClass(cell.column), | 623 | leftCellClass(cell.column), |
| 625 | dividerClass(cell.column), | 624 | dividerClass(cell.column), |
| 626 | stickyCellClass(cell.column), | 625 | stickyCellClass(cell.column), |
| 627 | cell.column.columnDef.meta?.cellClass, | 626 | cell.column.columnDef.meta?.cellClass, |
| 627 | + // After cellClass on purpose: values start at the | ||
| 628 | + // left edge in every table, and a page-level | ||
| 629 | + // text-center left over from an older layout | ||
| 630 | + // must not pull one column into the middle. | ||
| 631 | + alignClass[alignOf(cell.column)], | ||
| 628 | actionColumnClass(cell.column.id), | 632 | actionColumnClass(cell.column.id), |
| 629 | )} | 633 | )} |
| 630 | style={{ width: columnWidth(cell.column) }} | 634 | style={{ width: columnWidth(cell.column) }} |
src/pages/live-monitor-page.tsxmodified+1 -1
| @@ -211,7 +211,7 @@ function LiveMonitorContent() { | |||
| 211 | header: t("attempt.progress"), | 211 | header: t("attempt.progress"), |
| 212 | meta: { headerClass: "text-center", cellClass: "min-w-32 tabular-nums" }, | 212 | meta: { headerClass: "text-center", cellClass: "min-w-32 tabular-nums" }, |
| 213 | cell: (cell) => ( | 213 | cell: (cell) => ( |
| 214 | - <div class="flex items-center justify-center gap-2"> | 214 | + <div class="flex items-center gap-2"> |
| 215 | <span>{cell.row.original.answered}/{questionCount}</span> | 215 | <span>{cell.row.original.answered}/{questionCount}</span> |
| 216 | <div class="h-1.5 w-16 overflow-hidden rounded-full bg-muted"> | 216 | <div class="h-1.5 w-16 overflow-hidden rounded-full bg-muted"> |
| 217 | <div class="h-full rounded-full bg-primary" style={{ width: `${progressPercent(cell.row.original, questionCount)}%` }} /> | 217 | <div class="h-full rounded-full bg-primary" style={{ width: `${progressPercent(cell.row.original, questionCount)}%` }} /> |