Title: Add ability to add row in a loop to existing already-rendered table · Issue #166 · wp-cli/php-cli-tools · GitHub
Open Graph Title: Add ability to add row in a loop to existing already-rendered table · Issue #166 · wp-cli/php-cli-tools
X Title: Add ability to add row in a loop to existing already-rendered table · Issue #166 · wp-cli/php-cli-tools
Description: Feature Request Yes, I reviewed the contribution guidelines. Describe your use case and the problem you are facing I want to "register" an empty table, and then later in a loop using table reference ($table) add rows. Right now if I regi...
Open Graph Description: Feature Request Yes, I reviewed the contribution guidelines. Describe your use case and the problem you are facing I want to "register" an empty table, and then later in a loop using table referenc...
X Description: Feature Request Yes, I reviewed the contribution guidelines. Describe your use case and the problem you are facing I want to "register" an empty table, and then later in a loop using tabl...
Opengraph URL: https://github.com/wp-cli/php-cli-tools/issues/166
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add ability to add row in a loop to existing already-rendered table","articleBody":"## Feature Request\r\n\r\n- [x] Yes, I reviewed the [contribution guidelines](https://make.wordpress.org/cli/handbook/contributing/).\r\n\r\n**Describe your use case and the problem you are facing**\r\n\r\nI want to \"register\" an empty table, and then later in a loop using table reference (`$table`) add rows.\r\n\r\nRight now if I register a table, call the `display()` method to render it, and _then later_ call the \r\n```php\r\n$table->addRow(); \r\n$table->display();\r\n``` \r\nit will render the whole table again - with headers and previously added rows.\r\n\r\n\r\n**Describe the solution you'd like**\r\n\r\nI think separating `resetTable()` method into individual methods for header, rows, footer is needed.\r\n\r\nSo I should be able to either do this:\r\n\r\n```php\r\n$table->setHeaders();\r\n$table->display();\r\n\r\nforeach ($rows as $row) {\r\n\t$table->resetRows();\r\n\t$table->addRow($row);\r\n\t$table->display();\r\n}\r\n```\r\nor something like this:\r\n```php\r\n$table->setHeaders();\r\n$table->display();\r\n\r\nforeach ($rows as $row) {\r\n\t$table->displayRow($row);\r\n}\r\n```\r\n\r\nAlso, because header is a mandatory table data, displaying a new row should not render the top border but render the bottom row.","author":{"url":"https://github.com/slaFFik","@type":"Person","name":"slaFFik"},"datePublished":"2023-09-28T21:55:51Z","url":"https://github.com/wp-cli/php-cli-tools/issues/166"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c87c60c2-3449-5f4e-8a8d-3844bd80cc35 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 81B6:137FBB:1F8E5F4:297ABB1:6AF9F599 |
| html-safe-nonce | 4cf1086cf1b29ac61f3d3c0323c13c5ec99cc1dce66940691c974a13ae5382b8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MUI2OjEzN0ZCQjoxRjhFNUY0OjI5N0FCQjE6NkFGOUY1OTkiLCJ2aXNpdG9yX2lkIjoiNjg4NTU2Njg2MTA0NDU4NjQ5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 8aa81b018d36c36ddbb857d6714beb9e100ffaa2a85e68761d3b3c842a13c81b |
| hovercard-subject-tag | issue:1918324279 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/wp-cli/php-cli-tools/166/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b95253487f09fe9236754e791d703f96c65786b7c3eabf0837287bf7a7d8a842/wp-cli/php-cli-tools/issues/166 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b95253487f09fe9236754e791d703f96c65786b7c3eabf0837287bf7a7d8a842/wp-cli/php-cli-tools/issues/166 |
| og:image:alt | Feature Request Yes, I reviewed the contribution guidelines. Describe your use case and the problem you are facing I want to "register" an empty table, and then later in a loop using table referenc... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | slaFFik |
| hostname | github.com |
| expected-hostname | github.com |
| None | 612d3e6ffd693e7ea8d9fcf452370995872baef31d825b1fedef704cd3d24ac7 |
| turbo-cache-control | no-preview |
| go-import | github.com/wp-cli/php-cli-tools git https://github.com/wp-cli/php-cli-tools.git |
| octolytics-dimension-user_id | 1570774 |
| octolytics-dimension-user_login | wp-cli |
| octolytics-dimension-repository_id | 587642 |
| octolytics-dimension-repository_nwo | wp-cli/php-cli-tools |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 587642 |
| octolytics-dimension-repository_network_root_nwo | wp-cli/php-cli-tools |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 072e34035c13c31543fba9f025cbbbda4210dae4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width