docs: include warning about table offset (#408)

This commit is contained in:
bashbunni 2024-11-14 10:37:40 -08:00 committed by GitHub
parent 2d260ce065
commit f34b553405
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View File

@ -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

View File

@ -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