{"id":20979861,"url":"https://github.com/brettski/go-termtables","last_synced_at":"2025-05-14T15:30:28.952Z","repository":{"id":57488329,"uuid":"202899447","full_name":"brettski/go-termtables","owner":"brettski","description":"Easily build tables in your command line applications","archived":false,"fork":false,"pushed_at":"2024-12-19T14:24:36.000Z","size":152,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T19:47:00.652Z","etag":null,"topics":["cli","command-line","golang","tables"],"latest_commit_sha":null,"homepage":"https://github.com/brettski/go-termtables","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/brettski.png","metadata":{"files":{"readme":"README-apcera.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":"2019-08-17T15:38:10.000Z","updated_at":"2025-01-10T18:22:20.000Z","dependencies_parsed_at":"2022-08-29T15:01:35.455Z","dependency_job_id":null,"html_url":"https://github.com/brettski/go-termtables","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brettski%2Fgo-termtables","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brettski%2Fgo-termtables/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brettski%2Fgo-termtables/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brettski%2Fgo-termtables/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brettski","download_url":"https://codeload.github.com/brettski/go-termtables/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254171518,"owners_count":22026456,"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":["cli","command-line","golang","tables"],"created_at":"2024-11-19T05:14:46.053Z","updated_at":"2025-05-14T15:30:27.746Z","avatar_url":"https://github.com/brettski.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"_This repository was restored [here](https://github.com/brettski/go-termtables) after Apcera deleted their termtables repository on github. I was using the library on a project of mine and wanted to keep it around._\n\n# Original Content (working on updating)\n\n---\n\n# Termtables\n\n[![Build Status](https://travis-ci.org/apcera/termtables.svg?branch=master)](https://travis-ci.org/apcera/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/apcera/termtables\n```\n\n## Go Style Documentation\n\n[http://godoc.org/github.com/apcera/termtables](http://godoc.org/github.com/apcera/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/apcera/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%2Fbrettski%2Fgo-termtables","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrettski%2Fgo-termtables","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrettski%2Fgo-termtables/lists"}