{"id":13804922,"url":"https://github.com/serkonda7/termtable","last_synced_at":"2025-05-13T18:32:57.503Z","repository":{"id":50918173,"uuid":"306145742","full_name":"serkonda7/termtable","owner":"serkonda7","description":"Simple and highly customizable library to display tables in the terminal.","archived":true,"fork":false,"pushed_at":"2023-06-20T14:48:58.000Z","size":254,"stargazers_count":43,"open_issues_count":4,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-18T21:46:45.955Z","etag":null,"topics":["ascii","cli","hacktoberfest","table","terminal","v","vlang"],"latest_commit_sha":null,"homepage":"","language":"V","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serkonda7.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"serkonda7"}},"created_at":"2020-10-21T20:56:02.000Z","updated_at":"2024-05-27T13:10:52.000Z","dependencies_parsed_at":"2024-05-03T03:01:38.871Z","dependency_job_id":"650850a8-e966-49e2-91cc-9cf047a17b5c","html_url":"https://github.com/serkonda7/termtable","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serkonda7%2Ftermtable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serkonda7%2Ftermtable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serkonda7%2Ftermtable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serkonda7%2Ftermtable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serkonda7","download_url":"https://codeload.github.com/serkonda7/termtable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254003463,"owners_count":21997891,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ascii","cli","hacktoberfest","table","terminal","v","vlang"],"created_at":"2024-08-04T01:00:55.357Z","updated_at":"2025-05-13T18:32:57.076Z","avatar_url":"https://github.com/serkonda7.png","language":"V","funding_links":["https://github.com/sponsors/serkonda7"],"categories":["Libraries"],"sub_categories":["Command line interface (CLI) / Terminal / Shell"],"readme":"# V Terminal Tables\n![CI](https://github.com/serkonda7/termtable/workflows/CI/badge.svg?branch=master)\n\nSimple and highly customizable library to display tables in the terminal.\n\n\n## Features\n- Choose from seven predefined [styles](#predefined-styles)\n- Or create any [custom style](#creating-custom-styles) you want\n- [Tab support](#tabsize)\n- [Unicode support](test/../tests/unicode/cjk.out)\n\n\n## Installation\n`v install serkonda7.termtable`\n\n\n## Usage\n```v\nimport serkonda7.termtable as tt\n\nfn main() {\n\tdata := [\n\t\t['Name', 'Age', 'Sex'],\n\t\t['Max', '13', 'male'],\n\t\t['Moritz', '12', 'male'],\n\t\t['Lisa', '42', 'female'],\n\t]\n\tt := tt.Table{\n\t\tdata: data\n\t\t// The following settings are optional and have these defaults:\n\t\tstyle: .grid\n\t\theader_style: .bold\n\t\talign: .left\n\t\torientation: .row\n\t\tpadding: 1\n\t\ttabsize: 4\n\t}\n\tprintln(t)\n}\n```\n\n\n### Predefined Styles\nSupported values for `style: ...` are:\n- .grid\n- .pretty\n- .plain\n- .simple\n- .fancy_grid\n- .md\n- .rst\n\n`.grid` (default):\n\n![](img/grid.png)\n\n`.pretty`:\n\n![](img/pretty.png)\n\n`.plain`:\n\n![](img/plain.png)\n\n`.simple`:\n\n![](img/simple.png)\n\n`.fancy_grid`:\n\n![](img/fancy_grid.png)\n\n`.md` follows the conventions of [Markdown][md-tables]. It does not add alignment colons though:\n\n![](img/md.png)\n\n`.rst` behaves like the [reStructuredText][rst-tables] simple table format:\n\n![](img/rst.png)\n\n\n### Header Style\n```v\n// header_style: ...\n```\n| `.bold (default)` | `.plain` |\n| :-------: | :-------: |\n| ![](img/header_bold.png) | ![](img/header_plain.png) |\n\n\n### Alignment\n```v\n// align: ...\n| Max    | 13  | male   |  // .left (default)\n|  Max   | 13  |  male  |  // .center\n|    Max |  13 |   male |  // .right\n```\n\n\n### Orientation\n```v\nt := tt.Table{\n\tdata: [\n\t\t['Name', 'Age'],\n\t\t['Max', '13'],\n\t\t['Moritz', '12'],\n\t]\n\t// orientation: ...\n}\nprintln(t)\n```\n| `.row (default)` | `.column` |\n| :-------: | :-------: |\n| ![](img/orientation_row.png) | ![](img/orientation_column.png) |\n\n\n### Padding\nControl the count of spaces between the cell border and the item.\n```v\n// padding: ...\n|   Lisa   |   42   |   female   |  // 3\n\n| Lisa | 42 | female |  // 1 (default)\n\n|Lisa|42|female|  // 0\n```\n\n\n### Tabsize\n```v\nt := tt.Table{\n\tdata: [\n\t\t['\\tName', 'Sex'],\n\t\t['1.\\tMax', 'male\\t'],\n\t\t['2. \\tMoritz', '\\tmale'],\n\t]\n\t// tabsize: ...\n}\nprintln(t)\n```\n\n| `4 (default)` | `2` | `8` |\n| :-------: | :-------: | :-------: |\n| ![](img/tab-4.png) | ![](img/tab-2.png) | ![](img/tab-8.png) |\n\n\n### Creating Custom Styles\nTo create a custom style set the tables style property to `style: .custom`\nand specify `custom_style: tt.StyleConfig{...}`.\n\n#### `StyleConfig` Struct\n```v\ntopline      tt.Sepline{...}\nheaderline   tt.Sepline{...}\nmiddleline   tt.Sepline{...}\nbottomline   tt.Sepline{...}\ncolsep       string\nfill_padding bool = true\n```\n\n#### `Sepline` Struct\n```v\nleft  string\nright string\ncross string\nsep   string\n```\n\n\n## Acknowledgements\n- Images were made with [carbon][carbon-repo] and optimized with [image-actions][image-actions-repo]\n\n\n## License\nLicensed under the [MIT License](LICENSE.md)\n\n\n\u003c!-- Links --\u003e\n[md-tables]: https://www.markdownguide.org/extended-syntax#tables\n[rst-tables]: https://docutils.sourceforge.io/docs/user/rst/quickref.html#tables\n[carbon-repo]: https://github.com/carbon-app/carbon\n[image-actions-repo]: https://github.com/calibreapp/image-actions\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserkonda7%2Ftermtable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserkonda7%2Ftermtable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserkonda7%2Ftermtable/lists"}