Closed wwboynton closed 9 years ago
Hi Wesley,
The colouring of content and borders is something I was meant to do but have never added. I remember I had discussion with yourself about tables rendering some time ago and I still intend to deliver on the promises and extract the library. I had a bad patch of bronchitis that kind of sapped my energy levels(excuses :smile: )
I would really appreciate your help figuring out the code needed to get this done and submitting PR.
@wwboynton I've released tty-table
which has been revamped - removed some code bloat and dependencies. Going forward I will work on and would encourage you to fork the https://github.com/peter-murach/tty-table if you wish to submit PRs. Next step is to fix all the issues from the tty repository including colouring of content and borders.
Finally fixed and released as tty-table v0.2.0
! see
When printing a table, the ANSI escape sequences factor into the column width detection, so columns with colored fields are significantly wider than they appear to need to be.
I tried patching the length function in TTY::Table::Field to strip color codes before length detection, which corrected the top borders. However, the rows including coloring still wouldn't pad correctly.
Is there some other way to do this? If not, I'll keep poking through for the function which pads the fields and submit a pull request if I fix it.