gajus / table

Formats data into a string table.
Other
903 stars 77 forks source link

Add option to disable wordWrap altogether (willing to implement) #117

Open IanEdington opened 4 years ago

IanEdington commented 4 years ago

I have links in my table that are being parsed by a parser (Slack). Currently this makes the tables have a huge amount of space on the linked

╔═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╤═══════════╤══════════════╤══════════════╗
║ Setting                                                                                                                                         │ Values    │ Last updated │ Authored     ║
╟─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼───────────┼──────────────┼──────────────╢
║ SOME_SETTING_NAME │ 50% true  │ 19 months    │ Jan 10, 2019 ║
╚═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╧═══════════╧══════════════╧══════════════╝

currently using width, with or without wordWrap enabled give this:

╔══════════════════════════════════════════════════╤═══════════╤══════════════╤══════════════╗
║ Setting                                          │ Values    │ Last updated │ Authored     ║
╟──────────────────────────────────────────────────┼───────────┼──────────────┼──────────────╢
║ <https://www.a_very_long_url_that_just_keeps_goi │ 50% true  │ 19 months    │ Aug 10, 2019 ║
║ ng_and_finally.stops?q=SOME_SETTING_NAME|SOME_SE │           │              │              ║
║ TTING_NAME>                                      │           │              │              ║
╚══════════════════════════════════════════════════╧═══════════╧══════════════╧══════════════╝

Which totally makes sense as a default.

I would link to add an option that sets the width but disables wrapping altogether.

This option could either be overloading wordWrap aka wordWrap='disable' or a new flag like disableWordWrap.

Are you open to adding another option for this use case? Looking for feedback before implementing.

PS thanks for a great tool

nam-hle commented 3 years ago

Hi @IanEdington, it seems that you don't have enough time to work on the PR. I'm willing to help you but honestly I don't understand what you expects. Can you show me your expected output?