Fixed Columns

Freeze columns on the left or right while scrolling horizontally.

Usage

Fix Columns on the Left

var config = DataTableConfiguration()
config.fixedColumns = .left(count: 1)  // Freeze first column

Fix Columns on the Right

config.fixedColumns = .right(count: 2)  // Freeze last 2 columns

Fix Columns on Both Sides

config.fixedColumns = .both(left: 1, right: 1)

Example: Employee Directory

// ID column stays visible while scrolling through details
var config = DataTableConfiguration()
config.fixedColumns = .left(count: 1)

let columns: [DataTableColumn<Employee>] = [
    .init("ID", \.employeeId),        // Fixed
    .init("Name", \.name),            // Scrolls
    .init("Department", \.department), // Scrolls
    .init("Email", \.email),          // Scrolls
    .init("Phone", \.phone)           // Scrolls
]

let dataTable = SwiftDataTable(data: employees, columns: columns, options: config)