Page MenuHomePhabricator

Fix the width of `PhutilConsoleTable` if the header row is wider than the data rows.
ClosedPublic

Authored by joshuaspence on Jun 16 2014, 10:02 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 22, 10:46 PM
Unknown Object (File)
Fri, Apr 12, 3:20 PM
Unknown Object (File)
Fri, Apr 12, 3:20 PM
Unknown Object (File)
Fri, Apr 12, 3:20 PM
Unknown Object (File)
Tue, Apr 2, 5:30 AM
Unknown Object (File)
Mar 24 2024, 6:50 PM
Unknown Object (File)
Mar 5 2024, 5:41 PM
Unknown Object (File)
Feb 7 2024, 9:17 PM
Subscribers

Details

Summary

Currently, the width of the header text is not taken into consideration when drawing the table. The width of the header text must be accounted for as if it were an ordinary row. Specifically, the following error occurs otherwise:

PHP Warning:  str_repeat(): Second argument has to be greater than or equal to 0 in /home/joshua/workspace/github.com/phacility/libphutil/src/console/PhutilConsoleTable.php on line 211
Test Plan

Drew a table with a really wide header column. verified that no warnings were raised and that the table rendered correctly.

Diff Detail

Repository
rPHU libphutil
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

joshuaspence retitled this revision from to Fix the width of `PhutilConsoleTable` if the header row is wider than the data rows..
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
src/console/PhutilConsoleTable.php
197

This feels okay but not great (removing the padding here, that is).

epriestley edited edge metadata.
This revision is now accepted and ready to land.Jun 16 2014, 10:24 PM