table_print
table_print copied to clipboard
Output to HTML
This gem looks promising for console output, but it would be awesome if it could also output to HTML with a helper method (Rails) for use in views.
I've seen a comment in another PR that you wanted to do this and was wondering if it was in the pipeline and if yes, how far away is this feature?
Thanks!
It will be relatively straightforward to output plain HTML. What will be more difficult is letting you add custom markup (classes, etc) to that base table. What are your thoughts on just plain tr/td tags? Still useful for you?
Overall I think HTML is an important addition that will make table_print useful for many more people. Honestly the next few weeks are pretty busy for me but I can at least commit to making HTML output the top priority for this project.
Thanks for your feedback! :)
I may be stating the obvious, but if it's only for debug purpose, I use this helper :
def tp_pre data, options={}
content_tag :pre, TablePrint::Printer.new(data, options).table_print
end
all the time.
haha! It's obvious now that you said it :) I always forget about pre tags. I'll add that to the README, thanks!
whoops, didn't mean to close this issue. I think actual <td>
elements will still be useful.