bubbles icon indicating copy to clipboard operation
bubbles copied to clipboard

table.WithWidth doesn't work properly

Open caarlos0 opened this issue 1 year ago • 3 comments

Describe the bug Setting it to almost any value causes the table to be rendered in ways you probably didn't expect.

Setup Please complete the following information along with version numbers, if applicable.

  • OS [e.g. Ubuntu, macOS] any
  • Shell [e.g. zsh, fish] any
  • Terminal Emulator [e.g. kitty, iterm] any
  • Terminal Multiplexer [e.g. tmux] any
  • Locale [e.g. en_US.UTF-8, zh_CN.UTF-8, etc.] any

To Reproduce Steps to reproduce the behavior:

  1. You can copy the table example from bubbletea
  2. Add a table.WithWidth here
  3. Run it
  4. See it looks weid

Source Code https://github.com/charmbracelet/bubbletea/blob/d67033479573c91fc4a0e450fe84bbd0d6db6c5d/examples/table/main.go#L164

Expected behavior I'm not sure what it should do, but I think what it's doing now is wrong.

Screenshots CleanShot 2025-01-07 at 13 01 24@2x CleanShot 2025-01-07 at 13 01 41@2x

Additional context If you remove the widths of the headers, the table is rendered empty. Not sure if intended, weird anyway.

caarlos0 avatar Jan 07 '25 16:01 caarlos0

i can fix him

LOL, in all seriousness I do wonder if my lipgloss table branch might fix this though. That thing is so close, just needs a bit of polish I think

bashbunni avatar Jan 16 '25 03:01 bashbunni

let me know if I can help you with it 🙏🏻

caarlos0 avatar Jan 16 '25 12:01 caarlos0

@caarlos0 just prepare a PR? ;)

activey avatar Jan 31 '25 08:01 activey