{"id":13491489,"url":"https://github.com/rodaine/table","last_synced_at":"2025-05-14T11:12:14.496Z","repository":{"id":52843577,"uuid":"42623943","full_name":"rodaine/table","owner":"rodaine","description":"Go CLI Table Generator","archived":false,"fork":false,"pushed_at":"2025-02-24T16:53:00.000Z","size":35,"stargazers_count":287,"open_issues_count":3,"forks_count":32,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-11T04:56:11.718Z","etag":null,"topics":["cli","table"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/rodaine/table","language":"Go","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/rodaine.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-09-17T01:02:56.000Z","updated_at":"2025-04-07T04:48:38.000Z","dependencies_parsed_at":"2023-12-20T11:28:02.270Z","dependency_job_id":"1a20d41c-c98e-489e-9c0c-15c81be2bd12","html_url":"https://github.com/rodaine/table","commit_stats":{"total_commits":22,"total_committers":7,"mean_commits":3.142857142857143,"dds":0.6818181818181819,"last_synced_commit":"a8aa9fe9fe7344432b062324318efc341d3fa8d0"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodaine%2Ftable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodaine%2Ftable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodaine%2Ftable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodaine%2Ftable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rodaine","download_url":"https://codeload.github.com/rodaine/table/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254129525,"owners_count":22019628,"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","table"],"created_at":"2024-07-31T19:00:57.439Z","updated_at":"2025-05-14T11:12:09.483Z","avatar_url":"https://github.com/rodaine.png","language":"Go","readme":"# table \u003cbr/\u003e [![GoDoc](https://godoc.org/github.com/rodaine/table?status.svg)](https://godoc.org/github.com/rodaine/table)\n\n![Example Table Output With ANSI Colors](http://res.cloudinary.com/rodaine/image/upload/v1442524799/go-table-example0.png)\n\nPackage table provides a convenient way to generate tabular output of any data, primarily useful for CLI tools.\n\n## Features\n\n- Accepts all data types (`string`, `int`, `interface{}`, everything!) and will use the `String() string` method of a type if available.\n- Can specify custom formatting for the header and first column cells for better readability.\n- Columns are left-aligned and sized to fit the data, with customizable padding.\n- The printed output can be sent to any `io.Writer`, defaulting to `os.Stdout`.\n- Built to an interface, so you can roll your own `Table` implementation.\n- Works well with ANSI colors ([fatih/color](https://github.com/fatih/color) in the example)!\n- Can provide a custom `WidthFunc` to accomodate multi- and zero-width characters (such as [runewidth](https://github.com/mattn/go-runewidth))\n\n## Usage\n\n**Download the package:**\n\n```sh\ngo get github.com/rodaine/table\n```\n\n**Example:**\n\n```go\npackage main\n\nimport (\n  \"fmt\"\n  \"strings\"\n\n  \"github.com/fatih/color\"\n  \"github.com/rodaine/table\"\n)\n\nfunc main() {\n  headerFmt := color.New(color.FgGreen, color.Underline).SprintfFunc()\n  columnFmt := color.New(color.FgYellow).SprintfFunc()\n\n  tbl := table.New(\"ID\", \"Name\", \"Score\", \"Added\")\n  tbl.WithHeaderFormatter(headerFmt).WithFirstColumnFormatter(columnFmt)\n\n  for _, widget := range getWidgets() {\n    tbl.AddRow(widget.ID, widget.Name, widget.Cost, widget.Added)\n  }\n\n  tbl.Print()\n}\n```\n\n_Consult the [documentation](https://godoc.org/github.com/rodaine/table) for further examples and usage information_\n\n## License\n\ntable is released under the MIT License (Expat). See the [full license](https://github.com/rodaine/table/blob/master/license).\n","funding_links":[],"categories":["Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodaine%2Ftable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frodaine%2Ftable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodaine%2Ftable/lists"}