{"id":21336805,"url":"https://github.com/dan-da/texttable-php","last_synced_at":"2025-07-12T12:32:52.322Z","repository":{"id":56961646,"uuid":"59527456","full_name":"dan-da/texttable-php","owner":"dan-da","description":"A handy PHP class for printing fixed-width text tables.","archived":false,"fork":false,"pushed_at":"2019-10-21T21:19:50.000Z","size":17,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-11T00:03:43.096Z","etag":null,"topics":["ascii-table","ascii-text-table","markdown-table","php-text-table","text-table","texttable"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dan-da.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":"2016-05-24T00:23:50.000Z","updated_at":"2022-12-02T18:08:20.000Z","dependencies_parsed_at":"2022-08-21T05:40:22.446Z","dependency_job_id":null,"html_url":"https://github.com/dan-da/texttable-php","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dan-da%2Ftexttable-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dan-da%2Ftexttable-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dan-da%2Ftexttable-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dan-da%2Ftexttable-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dan-da","download_url":"https://codeload.github.com/dan-da/texttable-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225820222,"owners_count":17529139,"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-table","ascii-text-table","markdown-table","php-text-table","text-table","texttable"],"created_at":"2024-11-21T23:55:21.213Z","updated_at":"2024-11-21T23:55:21.722Z","avatar_url":"https://github.com/dan-da.png","language":"PHP","readme":"# texttable-php\n\nA handy PHP class for printing fixed-width text tables.\n\nThere is also a class for printing human-friendly markdown tables.\n\nLet's see a couple examples, shall we?\n\n## Example Price History Report ( from [bitprices](https://github.com/dan-da/bitprices) )\n\n```\n+------------+------------------+-----------+-------------+----------------+---------------+----------+\n| Date       | BTC Amount       | USD Price | USD Amount  | USD Amount Now | USD Gain      | Type     |\n+------------+------------------+-----------+-------------+----------------+---------------+----------+\n| 2011-11-16 |  500000.00000000 |      2.46 |  1230000.00 |   189905000.00 |  188675000.00 | purchase |\n| 2011-11-16 | -500000.00000000 |      2.46 | -1230000.00 |  -189905000.00 | -188675000.00 | sale     |\n| 2013-11-26 |       0.00011000 |    913.95 |        0.10 |           0.04 |         -0.06 | purchase |\n| 2013-11-26 |      -0.00011000 |    913.95 |       -0.10 |          -0.04 |          0.06 | sale     |\n| 2014-11-21 |       0.00010000 |    351.95 |        0.04 |           0.04 |          0.00 | purchase |\n| 2014-12-09 |       0.00889387 |    353.67 |        3.15 |           3.38 |          0.23 | purchase |\n| 2015-06-05 |       0.44520000 |    226.01 |      100.62 |         169.09 |         68.47 | purchase |\n| 2015-06-07 |       0.44917576 |    226.02 |      101.52 |         170.60 |         69.08 | purchase |\n| 2015-10-17 |       0.00010000 |    270.17 |        0.03 |           0.04 |          0.01 | purchase |\n| 2015-11-05 |       0.00010000 |    400.78 |        0.04 |           0.04 |          0.00 | purchase |\n| Totals:    |       0.90356963 |           |      205.40 |         343.19 |        137.79 |          |\n+------------+------------------+-----------+-------------+----------------+---------------+----------+\n```\n\n## Days of the week.  From ./example-weekdays2.php\n\n```\n+-----------+--------+---------+----------+\n| Day       | Abbrev | Initial | Position |\n+-----------+--------+---------+----------+\n| Sunday    | Sun    | S       |        0 |\n| Monday    | Mon    | M       |        1 |\n| Tuesday   | Tue    | T       |        2 |\n| Wednesday | Wed    | W       |        3 |\n| Thursday  | Thu    | T       |        4 |\n| Friday    | Fri    | F       |        5 |\n| Saturday  | Sat    | S       |        6 |\n+-----------+--------+---------+----------+\n```\n\n\n# Usage.\n\n## You can install with composer.\n\n```\n    $ cd yourproject\n    $ composer require dan-da/texttable-php\n```\n\ninclude in your code via:\n\n```\nrequire_once 'path/to/vendor/autoload.php';\n```\n\n\n## Or just drop into your project.\n\nThere are no dependencies!\n\nSimply include texttable.class.php from any PHP file and use it!\n\nHere's a trivial example that prints info about the days of the week:\n\n\n```\n\u003c?php\n\nrequire_once( __DIR__ . '/texttable.class.php' );\n\n$data = [];\n\n$timestamp = strtotime('next Sunday');\n$days = array();\nfor ($i = 0; $i \u003c 7; $i++) {\n    $data[] = ['Day' =\u003e strftime('%A', $timestamp),\n               'Abbrev' =\u003e strftime('%a', $timestamp),\n               'Initial' =\u003e strftime('%A', $timestamp)[0],\n               'Position' =\u003e $i ];\n$timestamp = strtotime('+1 day', $timestamp);\n    \n}\n\necho \"  [  Table with header from first row keys. similar to db result set. ]\\n\";\necho texttable::table( $data );\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdan-da%2Ftexttable-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdan-da%2Ftexttable-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdan-da%2Ftexttable-php/lists"}