Skip to content

fix(examples): add missing WithWidth to table example#1598

Merged
andreynering merged 1 commit intocharmbracelet:mainfrom
shv-ng:fix/table-example-missing-rows
Feb 26, 2026
Merged

fix(examples): add missing WithWidth to table example#1598
andreynering merged 1 commit intocharmbracelet:mainfrom
shv-ng:fix/table-example-missing-rows

Conversation

@shv-ng
Copy link
Copy Markdown
Contributor

@shv-ng shv-ng commented Feb 26, 2026

Summary

Add missing table.WithWidth(42) to the table example.

Root cause

Without an explicit width set, the table has no bounds to render rows within,
resulting in a blank table body.

The width is derived from the sum of all column widths:
Rank(4) + City(10) + Country(10) + Population(10) = 34
+ 8 for borders = 42

Before

Table renders with no rows visible.

After

Table renders correctly with all rows and scroll behavior working.

Fixes #1597

  • I have read CONTRIBUTING.md.
  • I have created a discussion that was approved by a maintainer (for new features).

Without an explicit width, the table renders with no rows visible.
Width should be the sum of all column widths (34) plus borders (8) = 42.

Fixes charmbracelet#1597
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.18%. Comparing base (c751374) to head (a319aab).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1598   +/-   ##
=======================================
  Coverage   56.18%   56.18%           
=======================================
  Files          25       25           
  Lines        1285     1285           
=======================================
  Hits          722      722           
  Misses        479      479           
  Partials       84       84           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Member

@andreynering andreynering left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@andreynering andreynering merged commit 110a919 into charmbracelet:main Feb 26, 2026
21 checks passed
Maks1mS pushed a commit to stplr-dev/stplr that referenced this pull request Mar 3, 2026
This PR contains the following updates:

| Package | Type | Update | Change | OpenSSF |
|---|---|---|---|---|
| [charm.land/bubbletea/v2](https://github.com/charmbracelet/bubbletea) | require | patch | `v2.0.0` → `v2.0.1` | [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/charmbracelet/bubbletea/badge)](https://securityscorecards.dev/viewer/?uri=github.com/charmbracelet/bubbletea) |

---

> ⚠️ **Warning**
>
> Some dependencies could not be looked up. Check the [Dependency Dashboard](issues/23) for more information.

---

### Release Notes

<details>
<summary>charmbracelet/bubbletea (charm.land/bubbletea/v2)</summary>

### [`v2.0.1`](https://github.com/charmbracelet/bubbletea/releases/tag/v2.0.1)

[Compare Source](charmbracelet/bubbletea@v2.0.0...v2.0.1)

A small patch release to fix opening the proper default stdin file for input.

#### Changelog

##### Fixed

- [`110a919`](charmbracelet/bubbletea@110a919): fix(examples): add missing `WithWidth` to table example ([#&#8203;1598](charmbracelet/bubbletea#1598)) ([@&#8203;shv-ng](https://github.com/shv-ng))
- [`66b7abd`](charmbracelet/bubbletea@66b7abd): fix: check if os.Stdin is a terminal before opening the TTY ([@&#8203;aymanbagabas](https://github.com/aymanbagabas))

##### Docs

- [`c751374`](charmbracelet/bubbletea@c751374): docs: correct whats new link ([@&#8203;aymanbagabas](https://github.com/aymanbagabas))
- [`736fba2`](charmbracelet/bubbletea@736fba2): docs: upgrade guide: correct badge url ([@&#8203;aymanbagabas](https://github.com/aymanbagabas))

***

<a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Ca+href%3D"https://charm.land/"><img" rel="nofollow">https://charm.land/"><img alt="The Charm logo" src="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Ca+href%3D"https://stuff.charm.sh/charm-banner-next.jpg" rel="nofollow">https://stuff.charm.sh/charm-banner-next.jpg" width="400"></a>

Thoughts? Questions? We love hearing from you. Feel free to reach out on [X](https://x.com/charmcli), [Discord](https://charm.land/discord), [Slack](https://charm.land/slack), [The Fediverse](https://mastodon.social/@&#8203;charmcli), [Bluesky](https://bsky.app/profile/charm.land).

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At 12:00 AM through 04:59 AM and 10:00 PM through 11:59 PM, Monday through Friday ( * 0-4,22-23 * * 1-5 ), Only on Sunday and Saturday ( * * * * 0,6 ) (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My40OC4yIiwidXBkYXRlZEluVmVyIjoiNDMuNDguMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiS2luZC9EZXBlbmRlbmNpZXMiXX0=-->

Reviewed-on: https://altlinux.space/stapler/stplr/pulls/342
Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
zmwangx added a commit to zmwangx/bubbles that referenced this pull request Mar 6, 2026
Table now requires an explicit width or the table body is rendered as
blank. This is fixed in the official example in
charmbracelet/bubbletea#1598, but it was not at all
obvious from reading the upgrade guide, making for a confusing upgrade
experience.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

examples/table doesn't show any rows

2 participants