ReoGrid ReoGrid Web

Table Styles

Since v1.4.0 you can turn a range into a live Excel-style table (a ListObject) with a built-in banded style. The styling is a computed overlay — banded rows and columns re-flow automatically as the table grows or shrinks, and it is not baked into individual cell formatting.

Note: Creating and styling tables is a Pro feature. Reading tables (getTable, getTables, getTableAt) is available in Lite, so tables authored in Pro — or imported from xlsx — still surface in the free tier.

Formatting a range as a table

The most direct route is RangeHandle.formatAsTable:

import { createReogrid } from '@reogrid/pro'

const grid = createReogrid({ workspace: '#app' })
const ws = grid.worksheet

// A1:D20 — first row is the header
const table = ws.range('A1:D20').formatAsTable({ style: 'TableStyleMedium9' })
console.log(table.name)  // 'Table1'

Or call addTable with an explicit RangePosition (top-left + counts):

const table = ws.addTable(
  { row: 0, col: 0, rows: 20, columns: 4 }, // A1:D20, includes the header row
  { name: 'Sales', style: 'TableStyleMedium2', showRowStripes: true },
)

Both return a TableDefinition describing the table (id, name, full range including headers, derived columns, and style info).

AddTableOptions

OptionTypeDefaultDescription
namestringauto (Table1, Table2, …)Unique-in-workbook internal name.
stylestring'TableStyleMedium2'Built-in OOXML style name (see below).
headerRowCount0 | 11Whether the first row is a header.
showRowStripesbooleanstyle defaultBanded (striped) rows.
showColumnStripesbooleanstyle defaultBanded columns.
showFirstColumnbooleanstyle defaultEmphasize the first column.
showLastColumnbooleanstyle defaultEmphasize the last column.

Style names

style is an OOXML built-in table-style name. ReoGrid ships a curated subset of the standard palette:

FamilyNames
LightTableStyleLight1TableStyleLight21
MediumTableStyleMedium1TableStyleMedium28
DarkTableStyleDark1TableStyleDark11

The name is preserved verbatim through import/export even when rendered with the fallback palette, so a table styled in ReoGrid keeps its style identity in Excel.

Banding re-flows automatically

Because the style is an overlay rather than baked-in cell formatting, the row/column stripes recompute whenever the table’s shape changes — insert a row in the middle and the alternating bands stay correct with no manual restyling. Toggle banding at any time:

ws.range('A1:D20').formatAsTable({ style: 'TableStyleMedium9', showColumnStripes: true })

Reading and removing tables (Lite-readable)

ws.getTables()            // TableDefinition[] on the sheet
ws.getTable('Sales')      // by name
ws.getTableAt(3, 1)       // the table covering a cell, or undefined
ws.removeTable('Sales')   // drop the table (cells keep their values)

getTable, getTables, and getTableAt work in Lite, so you can detect and read tables even without a Pro license.

xlsx round-trip

Tables serialize to xl/tables/tableN.xml with their style info and column names, so they open in Excel as native tables — and Excel tables import back as ReoGrid tables. They also round-trip through ReoGrid JSON.

Stay Updated

Be first to know — get updates as they ship

Get notified of new releases, features, and announcements.
No spam — just updates that matter.