Skip to content

feat(table): add OverflowRow option to disable overflow row#705

Closed
xbrxr03 wants to merge 1 commit into
charmbracelet:mainfrom
xbrxr03:feat/table-overflow-disable
Closed

feat(table): add OverflowRow option to disable overflow row#705
xbrxr03 wants to merge 1 commit into
charmbracelet:mainfrom
xbrxr03:feat/table-overflow-disable

Conversation

@xbrxr03

@xbrxr03 xbrxr03 commented Jun 22, 2026

Copy link
Copy Markdown

Problem

When a table has more data rows than can fit in its configured Height, lipgloss renders an overflow row with in each column. This tells the user there are more rows below. But if you're implementing pagination, that overflow row is redundant — you already know there are more pages.

Reported in #557.

Fix

Added OverflowRow(bool) and GetOverflowRow() to Table. Default is true (preserve existing behavior). Set to false to suppress the overflow row entirely.

table := table.New().
    Headers("Name", "Country").
    Row("Alice", "US").
    Row("Bob", "UK").
    Row("Carol", "DE").
    Row("Dave", "FR").
    Row("Eve", "JP").
    Height(5).
    OverflowRow(false)   // <-- no more "…" row

The change is minimal: a bool field on Table, a setter, a getter, and one condition in String() that gates the overflow row rendering. No changes to the height/scroll calculation logic.

Tests

4 new sub-tests under TestOverflowRowDisabled:

  • overflow_enabled_default: confirms appears with default settings
  • overflow_disabled: confirms is gone when OverflowRow(false)
  • overflow_disabled_shows_all: confirms output is identical when all rows fit regardless of setting
  • getter: confirms GetOverflowRow() returns correct defaults and after mutation

Full test suite: ok charm.land/lipgloss/v2/table 0.279s

Closes #557

When a table has more rows than can fit in its configured height,
lipgloss renders an overflow row with ellipsis (…) in each column to
indicate that more rows exist below. This is useful for scrollable
views but unwanted when implementing custom pagination.

Add OverflowRow(bool) setter and GetOverflowRow() getter. Default is
true to preserve existing behavior. Set to false to suppress the
overflow row.

Closes charmbracelet#557
@xbrxr03

xbrxr03 commented Jun 29, 2026

Copy link
Copy Markdown
Author

Closing this PR due to lack of maintainer engagement. I'm happy to reopen if there's interest. Thanks for the great project.

@xbrxr03 xbrxr03 closed this Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v2: Add option to disable table overflow row

2 participants