Skip to content

Commit

Permalink
docs: include warning about table offset (#408)
Browse files Browse the repository at this point in the history
  • Loading branch information
bashbunni authored Nov 14, 2024
1 parent 2d260ce commit f34b553
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,9 @@ fmt.Println(t)

![Table Example](https://github.com/charmbracelet/lipgloss/assets/42545625/6e4b70c4-f494-45da-a467-bdd27df30d5d)

> [!WARNING]
> Table `Rows` need to be declared before `Offset` otherwise it does nothing.
For more on tables see [the docs](https://pkg.go.dev/github.com/charmbracelet/lipgloss?tab=doc) and [examples](https://github.com/charmbracelet/lipgloss/tree/master/examples/table).

## Rendering Lists
Expand Down
3 changes: 3 additions & 0 deletions table/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ func (t *Table) Height(h int) *Table {
}

// Offset sets the table rendering offset.
//
// Warning: you may declare Offset only after setting Rows. Otherwise it will be
// ignored.
func (t *Table) Offset(o int) *Table {
t.offset = o
return t
Expand Down

0 comments on commit f34b553

Please sign in to comment.