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

Top border is not indented correctly when table has no headers #45

Open
rogermarlow opened this issue Mar 14, 2024 · 1 comment
Open
Labels

Comments

@rogermarlow
Copy link

Describe the problem

When rendering a table with an indent, if the table has no headers then the top border is not indented.

Steps to reproduce the problem

require 'tty-table'

ok = TTY::Table.new(header: ["H1","H2","H3"])
ok << ["a1","a2","a3"]
ok << ["b1","b2","b3"]

puts ok.render(:ascii, indent: 12)

broken = TTY::Table.new
broken << ["a1","a2","a3"]
broken << ["b1","b2","b3"]

puts broken.render(:ascii, indent: 12)

Actual behaviour

            +--+--+--+
            |H1|H2|H3|
            +--+--+--+
            |a1|a2|a3|
            |b1|b2|b3|
            +--+--+--+
+--+--+--+
            |a1|a2|a3|
            |b1|b2|b3|
            +--+--+--+

Expected behaviour

            +--+--+--+
            |H1|H2|H3|
            +--+--+--+
            |a1|a2|a3|
            |b1|b2|b3|
            +--+--+--+
            +--+--+--+
            |a1|a2|a3|
            |b1|b2|b3|
            +--+--+--+

Describe your environment

  • OS version: Darwin Kernel Version 23.2.0
  • Ruby version: v3.2.1
  • TTY::Table version: 0.12.0
@rogermarlow
Copy link
Author

I have raised PR #44 to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant