-
-
Notifications
You must be signed in to change notification settings - Fork 224
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
Should a table outputted using the dataTable formatter be longer than the wordwrap limit? #251
Comments
Sorry for the late reply. Yes, you got it right. Trying to fit an arbitrary table into an overall width limit will require more complicated logic. I have plans for other |
Ah okay I see, that makes sense. I am using this for formatting emails for NeoMutt and a lot of emails use tables to align things a certain way. I created a JavaScript formatter that will format the table in the same way that the browser does (as described here). I tested it and validated that the output is the same as it is in Chrome for the same table when I use a monospace font and set the width of the table in I took a stab at it from an email viewpoint based on a few emails I found. These are some things that I took into consideration with my implementation. "Invalid" tables have each cell displayed just as a normal block element.
The way I have it implemented plays nicely with colspan/rowspan (was a little bit messy when finding empty rows/columns), and would be fairly easy to add an option to add minimum table widths (stretching them) as well. If you're open to it, once you make other dataTable formatter changes I can adjust my formatter to those changes, write some tests, and open up an MR. |
I am setting in the config
wordwrap: 80
(just as an example) so that all of the output is wrapped at 80 characters. It seems to work beautifully, except when it comes to dataTable formatted tables. The tables seem to be however long they need to be, but then will wrap each individual cell after the cell length reaches 80 characters.Looking at the documentation, technically that is what it says about the dataTables maxColumnWidth config.
This appears to directly say that the max column width will default to the global wordwrap limit. Each column individually won't be longer than the wordwrap limit, but all of the columns side by side will. That also seems to be how it works. But, it seems so counterintuitive that I thought it would be worth asking to see if I'm doing something or understanding something wrong.
I can't imagine a scenario where you would want all output lines to be wrapped at 80 characters except for those lines that are part of a table. Is that how the dataTable formatter is supposed to work?
The text was updated successfully, but these errors were encountered: