Column Pinning
Column pinning keeps columns visible at the left or right edge of the table while scrolling horizontally. Enable "Split pinned columns into multiple tables" to render pinned columns as separate table elements, which is useful when you need independent scrolling regions.
Username | Role | Account Status | Last Visited At | Visit Count |
|---|---|---|---|---|
| Edgar.Tremblay48 | moderator | active | 23 Jul 2024 22:38:31 PDT | 3 |
| Maximilian.Hayes45 | admin | suspended | 20 Apr 2025 14:28:27 PDT | 189 |
| Maximillia.Beatty | moderator | suspended | 09 Jun 2025 18:38:15 PDT | 77 |
| Kiarra_Lesch | admin | pending | 06 Jul 2025 09:04:32 PDT | 43 |
| Giovanna.Farrell | admin | suspended | 30 Jul 2025 23:28:55 PDT | 2 |
| Tomas_Mante | user | active | 11 Jun 2025 08:33:53 PDT | 11 |
| Kade.Johnston49 | admin | active | 29 Oct 2025 09:19:00 PDT | 12 |
| Kaylin_Renner49 | moderator | pending | 03 Apr 2025 17:02:22 PDT | 2 |
| Casandra_Sawayn | user | suspended | 02 Jul 2025 11:17:30 PDT | 2 |
| Maud.Bergstrom84 | moderator | active | 21 Jun 2024 14:17:32 PDT | 232 |
import {Component, signal} from "@angular/core"
import {FormsModule} from "@angular/forms"
import {ButtonModule} from "@qualcomm-ui/angular/button"
import {CheckboxModule} from "@qualcomm-ui/angular/checkbox"
import {ProgressRingModule} from "@qualcomm-ui/angular/progress-ring"
import {
type AngularTable,
createAngularTable,
TableModule,
} from "@qualcomm-ui/angular/table"
import {getCoreRowModel} from "@qualcomm-ui/core/table"
import {columns, createUserQuery, type User} from "./data"
import {LeftTable} from "./left-table"
import {PinnableHeader} from "./pinnable-header"
import {RightTable} from "./right-table"
@Component({
imports: [
TableModule,
ButtonModule,
ProgressRingModule,
FormsModule,
CheckboxModule,
PinnableHeader,
LeftTable,
RightTable,
],
selector: "column-pinning-demo",
template: `
<div class="flex w-full flex-col gap-4 p-2">
<div class="flex flex-wrap items-center gap-2">
<button q-button variant="outline" (click)="query.refetch()">
Regenerate
</button>
@if (query.isFetching()) {
<div q-progress-ring size="xs"></div>
}
</div>
<div>
<label
label="Split pinned columns into multiple tables"
q-checkbox
size="sm"
[(ngModel)]="isSplit"
></label>
</div>
<div class="flex gap-4">
@if (isSplit() && table().getIsSomeColumnsPinned("left")) {
<left-table [table]="table" />
}
@if (
(isSplit() && table().getCenterFlatHeaders().length) || !isSplit()
) {
<div q-table-root>
<div q-table-scroll-container>
<table q-table-table>
<thead q-table-header>
@for (
headerGroup of isSplit()
? table.getCenterHeaderGroups()
: table.getHeaderGroups();
track headerGroup.id
) {
<tr q-table-row>
@for (header of headerGroup.headers; track header.id) {
<th
pinnable-header
q-table-header-cell
[header]="header"
></th>
}
</tr>
}
</thead>
<tbody q-table-body>
@for (row of table.getRowModel().rows; track row.id) {
<tr q-table-row>
@for (
cell of isSplit()
? row.getCenterVisibleCells()
: row.getVisibleCells();
track cell.id
) {
<td q-table-cell>
<ng-container *renderCell="cell; let value">
{{ value }}
</ng-container>
</td>
}
</tr>
}
</tbody>
</table>
</div>
</div>
}
@if (isSplit() && table().getIsSomeColumnsPinned("right")) {
<right-table [table]="table" />
}
</div>
</div>
`,
})
export class ColumnPinningDemo {
protected readonly query = createUserQuery(10)
protected readonly isSplit = signal(false)
protected table: AngularTable<User> = createAngularTable(() => ({
columns,
data: this.query.data() || [],
getCoreRowModel: getCoreRowModel(),
}))
}Updated by Ryan Bower