3 ms·
Ask HN: How do I create a table in text (using hyphens, pipes and pluses)?
Every now and then I see people create fancy tables in plain text here on HN (either as a signature or in the comments). I remember seeing a lot of this in my UNIX days too and always wondered how it was done. I have a need for it now, so if you know how please help.
Thanks,
- gamedna 11y agoThe simple answer to your question is the obvious one: Manually. Use a text editor that has a "draw mode" or "draw mode plugin" emacs, or sublime text for example. If you would like to create them programmatically, some languages have modules that help you create them easily. Off the top of my head PrettyTable in python works quite well. https://pypi.python.org/pypi/PrettyTable https://pypi.python.org/pypi/PrettyTable Hope this helps.
- Sharlin 11y agoHave you tried, uh, googling? "Ascii table generator" seems to give several relevant hits.
- rcfox 11y agoEmacs will handle this for you: https://www.gnu.org/software/emacs/manual/html_node/emacs/Text-Based-Tables.html https://www.gnu.org/software/emacs/manual/html_node/emacs/Te...
- ddv 11y agohttp://www.tablesgenerator.com/text_tables http://www.tablesgenerator.com/text_tables