Skip to content

Commit 7361ac6

Browse files
Copilotswissspidy
andcommitted
Remove duplicate bottom border when displaying headers only
- Fix duplicate border issue when displaying table with headers but no rows - Update test to reflect correct behavior (single border after headers) - Improves visual consistency for incremental row display - All tests pass Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
1 parent b5c8e39 commit 7361ac6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/cli/Table.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ public function getDisplayLines() {
195195
$out = array_merge( $out, $row );
196196
}
197197

198-
if (isset($border)) {
198+
// Only add final border if there are rows
199+
if (!empty($this->_rows) && isset($border)) {
199200
$out[] = $border;
200201
}
201202

tests/Test_Table_Ascii.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,6 @@ public function testDrawWithHeadersNoData() {
249249
+----------+----------+
250250
| header 1 | header 2 |
251251
+----------+----------+
252-
+----------+----------+
253252

254253
OUT;
255254
$this->assertInOutEquals(array($headers, $rows), $output);

0 commit comments

Comments
 (0)