-
-
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
Align cells via filter #3
Comments
In addition, I have had times where it has actually printed the hash into the table instead of the value
|
On further inspection, the code from the readme does not work doing basic alignment at all.
|
I haven't had time to look into filtering yet. It is another thing on my list. I'm rather surprised that the alignment doesn't work for you. Have you run the code of master branch? I haven't released any of the fixes as I want to make sure that all the major issues and refactoring are done. I have written quite few tests including this one to ensure that alignment works fine. |
The thing with filtering is that it is run as a last operation after the padding, alignment had a go on formatting the individual field. Therefore, even if I change the filter to accept the hash this would have no impact on rendering in terms of alignment etc... I guess I would need to provide I kind of like how the filter is the last step and allows you to transform the renderer.filter = proc { |val, row, col| Verse.align(val, :center) } Did you have a chance to look at the alignment? |
Yes, alignment by hash before render-time does indeed seem to be working as intended. I do certainly feel that the inability to perform per-cell granular formatting would seem at home in the filter, though perhaps in some way other than the hash. |
Given the ability to align a cell by replacing its value with a hash containing {value: val, alignment: align) of some sort, one would expect the ability to do this in filters at render-time as well. For instance,
However, this produces the following:
The text was updated successfully, but these errors were encountered: