fix(tui): apply Width/MaxWidth to header row cells too
Header row was returning bare tableHeaderStyle with no width constraints, letting lipgloss table-level Width() inflate the # column.
This commit is contained in:
@@ -41,7 +41,11 @@ func (m Model) renderTable(headers []string, items int, buildRows func(start, en
|
|||||||
Rows(rows...).
|
Rows(rows...).
|
||||||
StyleFunc(func(row, col int) lipgloss.Style {
|
StyleFunc(func(row, col int) lipgloss.Style {
|
||||||
if row == table.HeaderRow {
|
if row == table.HeaderRow {
|
||||||
return tableHeaderStyle
|
h := tableHeaderStyle
|
||||||
|
if col < len(colWidths) && colWidths[col] > 0 {
|
||||||
|
h = h.Width(colWidths[col]).MaxWidth(colWidths[col])
|
||||||
|
}
|
||||||
|
return h
|
||||||
}
|
}
|
||||||
isSelected := row == selectedVisual
|
isSelected := row == selectedVisual
|
||||||
if styleOverride != nil {
|
if styleOverride != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user