-
Notifications
You must be signed in to change notification settings - Fork 22
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
feat: Added a helper function to print multiple tables at once. #392
Conversation
The function can be imported like this: import { printTables } from "console-table-printer/utils/table-helpers" And you can pass any number of tables into it in order to print them. |
PS:
|
For some reason this took way more effort than what it's worth. |
Wow, now that's a long time of inactivity there. |
as mentioned in #375 this does not seem like a feature that many would use. But also looking at code its little difficult to understand. Im okay to put the simpler version without considering the width. That way at least the most common cases will be handled. |
If the code is difficult to understand then I can explain it (or even refactor when I'm back from my trip) It basically tries to merge as many tables as possible, if the character limit is reached it then prints them below. Think of it like a buffer, you save data up to the buffer size and then flush the buffer. That's what I do, I make a "buffer" that gets flushed when the end is reached or the maximum character limit gets hit. |
@ArjixWasTaken thanks for putting time into this. But to make it maintainable, more things needs to be changed:
|
oof, pull bot made my PR empty... |
thankfully a version of the code is available here |
🎉 This PR is included in version 2.11.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
👀What is this pr about?
This PR aims to add a function that will print multiple tables at once.
If the size of the terminal cannot fit them side by side, it will print as many as it can at once
And print the others below, side by side.
🚀 Changes
Added
Fixed
#375