{"id":17041693,"url":"https://github.com/xlab/termtables","last_synced_at":"2026-03-09T00:32:03.873Z","repository":{"id":57509148,"uuid":"236233512","full_name":"xlab/termtables","owner":"xlab","description":"A fork of long-gone apcera/termtables, because I liked it.","archived":false,"fork":false,"pushed_at":"2020-01-25T22:07:08.000Z","size":143,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-30T05:33:56.290Z","etag":null,"topics":["apcera","ascii","cli","golang","markdown","terminal","termtables"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xlab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-25T21:39:34.000Z","updated_at":"2020-03-18T22:42:30.000Z","dependencies_parsed_at":"2022-08-30T07:10:37.000Z","dependency_job_id":null,"html_url":"https://github.com/xlab/termtables","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/xlab/termtables","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xlab%2Ftermtables","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xlab%2Ftermtables/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xlab%2Ftermtables/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xlab%2Ftermtables/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xlab","download_url":"https://codeload.github.com/xlab/termtables/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xlab%2Ftermtables/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30278517,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T20:45:49.896Z","status":"ssl_error","status_checked_at":"2026-03-08T20:45:49.525Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["apcera","ascii","cli","golang","markdown","terminal","termtables"],"created_at":"2024-10-14T09:13:15.175Z","updated_at":"2026-03-09T00:32:03.857Z","avatar_url":"https://github.com/xlab.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Termtables\n\n[![Build Status](https://travis-ci.org/xlab/termtables.svg?branch=master)](https://travis-ci.org/xlab/termtables)\n\nA [Go](http://golang.org) port of the Ruby library [terminal-tables](https://github.com/visionmedia/terminal-table) for\nfast and simple ASCII table generation.\n\n## Installation\n\n```bash\ngo get github.com/xlab/termtables\n```\n\n## Go Style Documentation\n\n[http://godoc.org/github.com/xlab/termtables](http://godoc.org/github.com/xlab/termtables)\n\n## APC Command Line usage\n\n`--markdown` — output a markdown table, e.g. `apc app list --markdown`\n\n`--html` — output an html table, e.g. `apc app list --html`\n\n`--ascii` — output an ascii table, e.g. `apc app list --ascii`\n\n## Basic Usage\n\n```go\npackage main\n\nimport (\n  \"fmt\"\n  \"github.com/xlab/termtables\"\n)\n\nfunc main() {\n  table := termtables.CreateTable()\n\n  table.AddHeaders(\"Name\", \"Age\")\n  table.AddRow(\"John\", \"30\")\n  table.AddRow(\"Sam\", 18)\n  table.AddRow(\"Julie\", 20.14)\n\n  fmt.Println(table.Render())\n}\n```\n\nResult:\n\n```\n+-------+-------+\n| Name  | Age   |\n+-------+-------+\n| John  | 30    |\n| Sam   | 18    |\n| Julie | 20.14 |\n+-------+-------+\n```\n\n## Advanced Usage\n\nThe package function-call `EnableUTF8()` will cause any tables created after\nthat point to use Unicode box-drawing characters for the table lines.\n\nCalling `EnableUTF8PerLocale()` uses the C library's locale functionality to\ndetermine if the current locale environment variables say that the current\ncharacter map is UTF-8.  If, and only if, so, then `EnableUTF8()` will be\ncalled.\n\nCalling `SetModeHTML(true)` will cause any tables created after that point\nto be emitted in HTML, while `SetModeMarkdown(true)` will trigger Markdown.\nNeither should result in changes to later API to get the different results;\nthe primary intended use-case is extracting the same table, but for\ndocumentation.\n\nThe table method `.AddSeparator()` inserts a rule line in the output.  This\nonly applies in normal terminal output mode.\n\nThe table method `.AddTitle()` adds a title to the table; in terminal output,\nthis is an initial row; in HTML, it's a caption.  In Markdown, it's a line of\ntext before the table, prefixed by `Table: `.\n\nThe table method `.SetAlign()` takes an alignment and a column number\n(indexing starts at 1) and changes all _current_ cells in that column to have\nthe given alignment.  It does not change the alignment of cells added to the\ntable after this call.  Alignment is only stored on a per-cell basis.\n\n## Known Issues\n\nNormal output:\n\n* `.SetAlign()` does not affect headers.\n\nMarkdown output mode:\n\n* When emitting Markdown, the column markers are not re-flowed if a vertical\n  bar is an element of a cell, causing an escape to take place; since Markdown\n  is often converted to HTML, this only affects text viewing.\n* A title in Markdown is not escaped against all possible forms of Markdown\n  markup (to avoid adding a dependency upon a Markdown library, as supported\n  syntax can vary).\n* Markdown requires headers, so a dummy header will be inserted if needed.\n* Table alignment is not reflected in Markdown output.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxlab%2Ftermtables","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxlab%2Ftermtables","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxlab%2Ftermtables/lists"}