{"id":19677871,"url":"https://github.com/donquixote/cellbrush","last_synced_at":"2025-04-04T21:09:39.466Z","repository":{"id":18542988,"uuid":"21744043","full_name":"donquixote/cellbrush","owner":"donquixote","description":"HTML tables with support for rowspan and colspan, with string keys for rows and columns, generated with PHP.","archived":false,"fork":false,"pushed_at":"2024-11-01T15:17:12.000Z","size":178,"stargazers_count":49,"open_issues_count":3,"forks_count":11,"subscribers_count":5,"default_branch":"1.x","last_synced_at":"2025-03-28T20:09:35.911Z","etag":null,"topics":["colspan","html-table","php","rowspan","tbody","thead"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/donquixote.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":"2014-07-11T16:49:44.000Z","updated_at":"2025-01-04T17:42:57.000Z","dependencies_parsed_at":"2024-11-11T17:40:34.437Z","dependency_job_id":"d4d2b807-eea9-483f-bcc9-8216bd2ca794","html_url":"https://github.com/donquixote/cellbrush","commit_stats":{"total_commits":80,"total_committers":2,"mean_commits":40.0,"dds":"0.025000000000000022","last_synced_commit":"09c70b421828624756e56591de41d5e86030f50e"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donquixote%2Fcellbrush","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donquixote%2Fcellbrush/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donquixote%2Fcellbrush/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donquixote%2Fcellbrush/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/donquixote","download_url":"https://codeload.github.com/donquixote/cellbrush/tar.gz/refs/heads/1.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247249530,"owners_count":20908212,"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":["colspan","html-table","php","rowspan","tbody","thead"],"created_at":"2024-11-11T17:35:33.985Z","updated_at":"2025-04-04T21:09:39.449Z","avatar_url":"https://github.com/donquixote.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cellbrush: Generate HTML tables with PHP\n\nA library to generate complex HTML tables with PHP, with support for rowspan and colspan.\n\n_If you read this in packagist, some parts fo this README are not visible. Go to [github](https://github.com/donquixote/cellbrush) instead._\n\n\nTable structure:\n\n* String keys to identify rows and columns when building the table.\n* Colspan and rowspan using column groups and row groups.\n* Remaining empty cells filled in automatically, to preserve the structural integrity.\n* Warning on cell collisions.\n\nTag attributes:\n\n* Easily add row classes.\n* Easily add row striping classes (odd/even zebra striping and more).\n* Easily add column classes that apply to all cells in the column.\n* Set html attributes for a row, or for all cells of a column.\n\nAPI design:\n\n* Method chaining instead of huge arrays of doom.\n* Shortcut notations for frequently used stuff.\n* Return value and parameter types nicely documented, so your IDE can let you know about possible operations.\n* Exceptions thrown for integrity violation.\n* Composer and PSR-4.\n\n\n## Basic usage\n\nA simple 3x3 table with the diagonal cells filled. \n\n```php\n$table = \\Donquixote\\Cellbrush\\Table\\Table::create()\n  -\u003eaddRowNames(['row0', 'row1', 'row2'])\n  -\u003eaddColNames(['col0', 'col1', 'col2'])\n  -\u003etd('row0', 'col0', 'Diag 0')\n  -\u003etd('row1', 'col1', 'Diag 1')\n  -\u003etd('row2', 'col2', 'Diag 2')\n;\n$html = $table-\u003erender();\n```\n\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\u003ctd\u003eDiag 0\u003c/td\u003e\u003ctd\u003e\u003c/td\u003e\u003ctd\u003e\u003c/td\u003e\u003c/tr\u003e\n    \u003ctr\u003e\u003ctd\u003e\u003c/td\u003e\u003ctd\u003eDiag 1\u003c/td\u003e\u003ctd\u003e\u003c/td\u003e\u003c/tr\u003e\n    \u003ctr\u003e\u003ctd\u003e\u003c/td\u003e\u003ctd\u003e\u003c/td\u003e\u003ctd\u003eDiag 2\u003c/td\u003e\u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\nToo verbose? Look for \"Shortcut syntax\" below.\n\n## Cells in thead and tfoot\n\nA table like above, but with added thead section.\n\nColumn names are shared between table sections, but new rows need to be defined for each section.\n\n```php\n$table = ...\n$table-\u003ethead()\n  -\u003eaddRowName('head row')\n  -\u003eth('head row', 'col0', 'H0')\n  -\u003eth('head row', 'col1', 'H1')\n  -\u003eth('head row', 'col2', 'H2')\n;\n$html = $table-\u003erender();\n```\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\u003cth\u003eH0\u003c/th\u003e\u003cth\u003eH1\u003c/th\u003e\u003cth\u003eH2\u003c/th\u003e\u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\u003ctd\u003eDiag 0\u003c/td\u003e\u003ctd\u003e\u003c/td\u003e\u003ctd\u003e\u003c/td\u003e\u003c/tr\u003e\n    \u003ctr\u003e\u003ctd\u003e\u003c/td\u003e\u003ctd\u003eDiag 1\u003c/td\u003e\u003ctd\u003e\u003c/td\u003e\u003c/tr\u003e\n    \u003ctr\u003e\u003ctd\u003e\u003c/td\u003e\u003ctd\u003e\u003c/td\u003e\u003ctd\u003eDiag 2\u003c/td\u003e\u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n## Additional tbody sections\n\nBy default, every addRowName() and td() or th() goes into the main tbody section.\n\nSo, the following two are equivalent:\n\n```php\n$table-\u003etd('row0', 'col0', 'Cell contents');\n$table-\u003etbody()-\u003etd('row0', 'col0', 'Cell contents');\n```\n\nMore named tbody sections can be added like this:\n\n```php\n$table-\u003etbody('tb1')\n  -\u003eaddRowName(..)\n  -\u003etd(..)\n```\n\nAgain, the column definitions are shared between table sections, but row\ndefinitions need to be added separately.\n\n\n## Full rowspan and colspan\n\nTo let a cell span the entire width of the table, simply set the column name to ''.\nLikewise, set the row name to '' to span the entire height of the table section.\n\n```php\n$table-\u003ethead()\n  -\u003eaddRowName('head row')\n  -\u003etd('head row', '', 'Horizontal cell in thead.')\n;\n$table\n  -\u003e...\n  -\u003etd('', 'col1', 'Vertical cell')\n;\n```\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\u003ctd colspan=\"3\"\u003eHorizontal cell in thead.\u003c/td\u003e\u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\u003ctd\u003e#\u003c/td\u003e\u003ctd rowspan=\"3\"\u003eVertical cell\u003c/td\u003e\u003ctd\u003e#\u003c/td\u003e\u003c/tr\u003e\n    \u003ctr\u003e\u003ctd\u003e#\u003c/td\u003e\u003ctd\u003e#\u003c/td\u003e\u003c/tr\u003e\n    \u003ctr\u003e\u003ctd\u003e#\u003c/td\u003e\u003ctd\u003e#\u003c/td\u003e\u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n## Column groups\n\nNamed column groups allow for cells with colspan.\nIn the below example, the column name \"products\" specifies a colspan cell that spans all 3 products.* cells, whereas \"products.a\", \"products.b\" and \"products.c\" specifies specific cells without colspan. \n\n```php\n$table-\u003eaddColNames(['legend', 'products.a', 'products.b', 'products.c']);\n$table-\u003ethead()\n  -\u003eaddRowName('head')\n  -\u003eth('head', 'legend', 'Legend')\n  // The \"Products\" label will span 3 columns: products.a, products.b, products.c\n  -\u003eth('head', 'products', 'Products')\n  -\u003eaddRowName('name')\n  -\u003eth('name', 'legend', 'Product name')\n  -\u003eth('name', 'products.a', 'Product A')\n  -\u003eth('name', 'products.b', 'Product B')\n  -\u003eth('name', 'products.c', 'Product C')\n;\n$table\n  -\u003eaddRowName('width')\n  -\u003eth('width', 'legend', 'Width')\n  -\u003etd('width', 'products.a', '55 cm')\n  -\u003etd('width', 'products.b', '102 cm')\n  ..\n  -\u003eaddRowName('height')\n  ..\n  -\u003eaddRowName('price')\n  -\u003etd('price', 'products.a', '7.66 EUR')\n```\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\u003cth\u003eLegend\u003c/th\u003e\u003cth colspan=\"3\"\u003eProducts\u003c/th\u003e\u003c/tr\u003e\n    \u003ctr\u003e\u003cth\u003eProduct name\u003c/th\u003e\u003cth\u003eProduct A\u003c/th\u003e\u003cth\u003eProduct B\u003c/th\u003e\u003cth\u003eProduct C\u003c/th\u003e\u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\u003cth\u003eWidth\u003c/th\u003e\u003ctd\u003e55 cm\u003c/td\u003e\u003ctd\u003e102 cm\u003c/td\u003e\u003ctd\u003e7 cm\u003c/td\u003e\u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\n## Row groups\n\nSimilar to column groups.\n\n```php\n$table = Table::create()\n  -\u003eaddColNames(['legend', 'sublegend', 0, 1])\n  -\u003eaddRowNames(['dimensions.width', 'dimensions.height', 'price'])\n  -\u003eth('dimensions', 'legend', 'Dimensions')\n  -\u003eth('dimensions.width', 'sublegend', 'Width')\n  -\u003eth('dimensions.height', 'sublegend', 'Height')\n  -\u003eth('price', 'legend', 'Price')\n;\n$table-\u003eheadRow()-\u003ethMultiple(['Product 0', 'Product 1']);\n$table-\u003erowHandle('dimensions.width')-\u003etdMultiple(['2cm', '5cm']);\n$table-\u003erowHandle('dimensions.height')-\u003etdMultiple(['14g', '22g']);\n$table-\u003erowHandle('price')-\u003etdMultiple(['7,- EUR', '5,22 EUR']);\n```\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\u003ctd\u003e\u003c/td\u003e\u003ctd\u003e\u003c/td\u003e\u003cth\u003eProduct 0\u003c/th\u003e\u003cth\u003eProduct 1\u003c/th\u003e\u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\u003cth rowspan=\"2\"\u003eDimensions\u003c/th\u003e\u003cth\u003eWidth\u003c/th\u003e\u003ctd\u003e2cm\u003c/td\u003e\u003ctd\u003e5cm\u003c/td\u003e\u003c/tr\u003e\n    \u003ctr\u003e\u003cth\u003eHeight\u003c/th\u003e\u003ctd\u003e14g\u003c/td\u003e\u003ctd\u003e22g\u003c/td\u003e\u003c/tr\u003e\n    \u003ctr\u003e\u003cth\u003ePrice\u003c/th\u003e\u003ctd\u003e\u003c/td\u003e\u003ctd\u003e7,- EUR\u003c/td\u003e\u003ctd\u003e5,22 EUR\u003c/td\u003e\u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n## Combination of row groups and column groups\n\n```php\n$table = (new Table())\n  // Add columns.\n  -\u003eaddColName('name')\n  -\u003eaddColNames(['info.color', 'info.price'])\n  // Add banana row group.\n  -\u003eaddRowNames(['banana.description', 'banana.info'])\n  -\u003eth('banana', 'name', 'Banana')\n  -\u003etd('banana.description', 'info', 'A yellow fruit.')\n  -\u003etd('banana.info', 'info.color', 'yellow')\n  -\u003etd('banana.info', 'info.price', '60 cent')\n;\n// Alternative syntax with handles, see \"Shortcut syntax\" below.\n$table-\u003eaddRow('coconut')-\u003eth('name', 'Coconut');\n$table-\u003eaddRow('coconut.description')-\u003etd('info', 'Has liquid inside.');\n$table-\u003eaddRow('coconut.info')\n  -\u003etd('info.color', 'brown')\n  -\u003etd('info.price', '3 dollar')\n;\n$table-\u003eheadRow()\n  -\u003eth('name', 'Name')\n  -\u003eth('info.color', 'Color')\n  -\u003eth('info.price', 'Price')\n;\n```\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\u003cth\u003eName\u003c/th\u003e\u003cth\u003eColor\u003c/th\u003e\u003cth\u003ePrice\u003c/th\u003e\u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\u003cth rowspan=\"2\"\u003eBanana\u003c/th\u003e\u003ctd colspan=\"2\"\u003eA yellow fruit.\u003c/td\u003e\u003c/tr\u003e\n    \u003ctr\u003e\u003ctd\u003eyellow\u003c/td\u003e\u003ctd\u003e60 cent\u003c/td\u003e\u003c/tr\u003e\n    \u003ctr\u003e\u003cth rowspan=\"2\"\u003eCoconut\u003c/th\u003e\u003ctd colspan=\"2\"\u003eHas liquid inside.\u003c/td\u003e\u003c/tr\u003e\n    \u003ctr\u003e\u003ctd\u003ebrown\u003c/td\u003e\u003ctd\u003e3 dollar\u003c/td\u003e\u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n## Nested groups\n\nGroups can have unlimited depth.\n\n```php\n$table = Table::create()\n  -\u003eaddRowNames(['T', 'B.T', 'B.B.T', 'B.B.B'])\n  -\u003eaddColNames(['L', 'R.L', 'R.R.L', 'R.R.R'])\n  -\u003etd('T', '', 'top')\n  -\u003etd('B', 'L', 'bottom left')\n  -\u003etd('B.T', 'R', 'B.T / R')\n  -\u003etd('B.B', 'R.L', 'B.B / R.L')\n  -\u003etd('B.B.T', 'R.R', 'B.B.T / R.R')\n  -\u003etd('B.B.B', 'R.R.L', 'B.B.B / R.R.L')\n  -\u003etd('B.B.B', 'R.R.R', 'B.B.B / R.R.R')\n;\n```\n\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\u003ctd colspan=\"4\"\u003etop\u003c/td\u003e\u003c/tr\u003e\n    \u003ctr\u003e\u003ctd rowspan=\"3\"\u003ebottom left\u003c/td\u003e\u003ctd colspan=\"3\"\u003eB.T / R\u003c/td\u003e\u003c/tr\u003e\n    \u003ctr\u003e\u003ctd rowspan=\"2\"\u003eB.B / R.L\u003c/td\u003e\u003ctd colspan=\"2\"\u003eB.B.T / R.R\u003c/td\u003e\u003c/tr\u003e\n    \u003ctr\u003e\u003ctd\u003eB.B.B / R.R.L\u003c/td\u003e\u003ctd\u003eB.B.B / R.R.R\u003c/td\u003e\u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n## Open-ended cells\n\nOpen-end cells allow overlapping colspan cells, like bricks in a wall.\n\n```php\n$table = (new Table())-\u003eaddColNames([0, 1, 2, 3, 4, 5, 6, 7]);\n$table-\u003eaddRow(0)-\u003etdMultiple([0, 1, 2, 3, 4, 5, 6, 7]);\n$table-\u003eaddRow(1)\n  -\u003etdOpenEnd(0, '0..2')\n  -\u003etdOpenEnd(3, '3..4')\n  -\u003etdOpenEnd(5, '5')\n  -\u003etdOpenEnd(6, '6..7')\n;\n$table-\u003eaddRow(2)\n  -\u003etdOpenEnd(0, '0..1')\n  -\u003etdOpenEnd(2, '2..3')\n  -\u003etdOpenEnd(4, '4..6')\n  -\u003etdOpenEnd(7, '7')\n;\n```\n\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e0\u003c/td\u003e\n      \u003ctd\u003e1\u003c/td\u003e\n      \u003ctd\u003e2\u003c/td\u003e\n      \u003ctd\u003e3\u003c/td\u003e\n      \u003ctd\u003e4\u003c/td\u003e\n      \u003ctd\u003e5\u003c/td\u003e\n      \u003ctd\u003e6\u003c/td\u003e\n      \u003ctd\u003e7\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd colspan=\"3\"\u003e0..2\u003c/td\u003e\n      \u003ctd colspan=\"2\"\u003e3..4\u003c/td\u003e\n      \u003ctd\u003e5\u003c/td\u003e\n      \u003ctd colspan=\"2\"\u003e6..7\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd colspan=\"2\"\u003e0..1\u003c/td\u003e\n      \u003ctd colspan=\"2\"\u003e2..3\u003c/td\u003e\n      \u003ctd colspan=\"3\"\u003e4..6\u003c/td\u003e\n      \u003ctd\u003e7\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\n## Shortcut syntax with row handles and column handles\n\nRowHandle and \\*ColHandle allow you to omit one of $rowName and $colName to address a table cell.\n\n```php\n$table = (new Table())\n  -\u003eaddRowNames(['row0', 'row1', 'row2'])\n  -\u003eaddColNames(['legend', 'col0', 'col1', 'col2'])\n  ...\n;\n// Add cells in a \"head0\" row in the thead section.\n$table-\u003eheadRow()\n  -\u003eth('col0', 'Column 0')\n  -\u003eth('col1', 'Column 1')\n  -\u003eth('col2', 'Column 2')\n;\n// Add cells in a \"legend\" column.\n$table-\u003ecolHandle('legend')\n  -\u003eth('row0', 'Row 0')\n  -\u003eth('row1', 'Row 1')\n  -\u003eth('row2', 'Row 2')\n;\n```\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\u003ctd\u003e\u003c/td\u003e\u003cth\u003eColumn 0\u003c/th\u003e\u003cth\u003eColumn 1\u003c/th\u003e\u003cth\u003eColumn 2\u003c/th\u003e\u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\u003cth\u003eRow 0\u003c/th\u003e\u003ctd\u003eDiag 0\u003c/td\u003e\u003ctd\u003e\u003c/td\u003e\u003ctd\u003e\u003c/td\u003e\u003c/tr\u003e\n    \u003ctr\u003e\u003cth\u003eRow 1\u003c/th\u003e\u003ctd\u003e\u003c/td\u003e\u003ctd\u003eDiag 1\u003c/td\u003e\u003ctd\u003e\u003c/td\u003e\u003c/tr\u003e\n    \u003ctr\u003e\u003cth\u003eRow 2\u003c/th\u003e\u003ctd\u003e\u003c/td\u003e\u003ctd\u003e\u003c/td\u003e\u003ctd\u003eDiag 2\u003c/td\u003e\u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\n## Row classes\n\nRow classes can be added quite easily with `addRowClass()`.\n\n```php\n$table-\u003eaddRowClass('row0', 'rowClass0');\n```\n\n## Row striping\n\nRow striping classes can be added to a table section with `addRowStriping()`.\n\nThe default striping is `['odd', 'even']`, but different patterns can be added with three or more stripes.\n\n```php\n// Odd/even zebra striping.\n$table-\u003eaddRowStriping();\n// 3-way striping.\n$table-\u003eaddRowStriping(['1of3', '2of3', '3of3']);\n```\n\nThe striping always applies to a table section. By default, this wil be the main tbody section.\n\n\n## Column classes\n\nYou can use `addColClass()` to add a class to all cells of a column.\nThis can be done either for all table sections at once, or for specific table sections.\n\n```php\n$table-\u003eaddColClass('col0', 'allSectionsColumn0');\n$table-\u003etbody()-\u003eaddColClass('col0', 'tbodyColumn0');\n```\n\n## Cell classes\n\nUse `addCellClass()` to add classes to individual cells.\n\n```php\n$table-\u003eaddCellClass('row0', 'col0', 'my_class');\n```\n\n## Column Reordering\n\nColumns can be reordered even after the cells are already added.\n\n```php\n// Create a table, and render it.\n$table = Table::create()\n  -\u003eaddRowNames(['row0', 'row1', 'row2'])\n  -\u003eaddColNames(['col0', 'col1', 'col2'])\n  -\u003etd('row0', 'col0', 'Diag 0')\n  -\u003etd('row1', 'col1', 'Diag 1')\n  -\u003etd('row2', 'col2', 'Diag 2')\n;\nprint $table-\u003erender();\n```\n\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\u003ctd\u003eDiag 0\u003c/td\u003e\u003ctd\u003e\u003c/td\u003e\u003ctd\u003e\u003c/td\u003e\u003c/tr\u003e\n    \u003ctr\u003e\u003ctd\u003e\u003c/td\u003e\u003ctd\u003eDiag 1\u003c/td\u003e\u003ctd\u003e\u003c/td\u003e\u003c/tr\u003e\n    \u003ctr\u003e\u003ctd\u003e\u003c/td\u003e\u003ctd\u003e\u003c/td\u003e\u003ctd\u003eDiag 2\u003c/td\u003e\u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n```php\n// Reorder the columns, and render again.\n$table-\u003esetColOrder(['col1', 'col2', 'col0']);\nprint $table-\u003erender();\n```\n\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\u003ctd\u003e\u003c/td\u003e\u003ctd\u003e\u003c/td\u003e\u003ctd\u003eDiag 0\u003c/td\u003e\u003c/tr\u003e\n    \u003ctr\u003e\u003ctd\u003eDiag 1\u003c/td\u003e\u003ctd\u003e\u003c/td\u003e\u003ctd\u003e\u003c/td\u003e\u003c/tr\u003e\n    \u003ctr\u003e\u003ctd\u003e\u003c/td\u003e\u003ctd\u003eDiag 2\u003c/td\u003e\u003ctd\u003e\u003c/td\u003e\u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n## More examples?\n\nYou can see more examples in [the unit tests](https://github.com/donquixote/cellbrush/tree/master/tests/src).\n\n## Planned features\n\nNext steps:\n\n* Collision detection.\n* Dedicated exception classes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdonquixote%2Fcellbrush","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdonquixote%2Fcellbrush","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdonquixote%2Fcellbrush/lists"}