[PR #62] [CLOSED] Expandable column #850

Closed
opened 2026-03-04 01:08:13 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/rivo/tview/pull/62
Author: @dmke
Created: 2/28/2018
Status: Closed

Base: masterHead: expandable-column


📝 Commits (4)

  • fb6fa2e add Table.SetExpandable for dynamic column width
  • d3025fb demo/presentation: show Table.SetExpandable
  • a8999a4 demo/presentation: extract table reset code
  • a934652 reworked calculation for expandable column width

📊 Changes

2 files changed (+91 additions, -33 deletions)

View changed files

📝 demos/presentation/table.go (+57 -27)
📝 table.go (+34 -6)

📄 Description

I've added a bit of code to mark a column as "expandable", i.e. to use the remaining horizontal space, effectively making any table a full-width table.

My use case is multiping, which should align the statistic column on the right, and the host information on the left (kind of like mtr)

expanded

For now, only one column can be made "expandable", but the API could later be upgraded to func (t *Table) SetExpandable(columns ...int) *Table to allow sharing the remaining space between multiple columns.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/rivo/tview/pull/62 **Author:** [@dmke](https://github.com/dmke) **Created:** 2/28/2018 **Status:** ❌ Closed **Base:** `master` ← **Head:** `expandable-column` --- ### 📝 Commits (4) - [`fb6fa2e`](https://github.com/rivo/tview/commit/fb6fa2eab5b2adf632904a7c6602272f61304671) add Table.SetExpandable for dynamic column width - [`d3025fb`](https://github.com/rivo/tview/commit/d3025fb140bdbcabfee234c4d00a3786f282efe4) demo/presentation: show Table.SetExpandable - [`a8999a4`](https://github.com/rivo/tview/commit/a8999a4a2dc85b495a647ea11dfae9caf13314a3) demo/presentation: extract table reset code - [`a934652`](https://github.com/rivo/tview/commit/a934652b351d90c415a158dc8e0c097ebd900347) reworked calculation for expandable column width ### 📊 Changes **2 files changed** (+91 additions, -33 deletions) <details> <summary>View changed files</summary> 📝 `demos/presentation/table.go` (+57 -27) 📝 `table.go` (+34 -6) </details> ### 📄 Description I've added a bit of code to mark a column as "expandable", i.e. to use the remaining horizontal space, effectively making any table a full-width table. My use case is [`multiping`](https://github.com/digineo/go-ping/tree/master/cmd/multiping), which should align the statistic column on the right, and the host information on the left (kind of like [`mtr`](https://github.com/traviscross/mtr)) ![expanded](https://user-images.githubusercontent.com/327411/36816432-0bc5e122-1cde-11e8-8312-bc0d9ad02dbd.png) For now, only one column can be made "expandable", but the API could later be upgraded to `func (t *Table) SetExpandable(columns ...int) *Table` to allow sharing the remaining space between multiple columns. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 01:08:13 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#850
No description provided.