Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(table): substract headers Y size from the total table size #434

Merged
merged 4 commits into from
Mar 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions table/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func WithRows(rows []Row) Option {
// WithHeight sets the height of the table.
func WithHeight(h int) Option {
return func(m *Model) {
m.viewport.Height = h
m.viewport.Height = h - lipgloss.Height(m.headersView())
}
}

Expand Down Expand Up @@ -296,7 +296,7 @@ func (m *Model) SetWidth(w int) {

// SetHeight sets the height of the viewport of the table.
func (m *Model) SetHeight(h int) {
m.viewport.Height = h
m.viewport.Height = h - lipgloss.Height(m.headersView())
m.UpdateViewport()
}

Expand Down
Loading