Page MenuHomePhabricator

Support <colgroup> in the verbose remarkup <table> syntax for specifying column widths
Open, LowPublic

Description

See PHI673. An install would like more control over display presentation of Remarkup tables which have been generated by a script, particularly control over column widths.

T13158 is a kind of meta-attack on this, but a simple reasonable thing we can do is to support <colgroup> + <col>.

That is, this syntax should work:

<table>
  <colgroup>
    <col width="25%" />
    <col width="25%" />
    <col />
  </colgroup>
  <tr>
    <td>x</td>
    <td>y</td>
    <td>z</td>
  </tr>
</table>

...and produce a table with 25%, 25%, and 50%-width columns.

To implement this, we need to make PhutilRemarkupTableBlockRule parse the syntax and then make renderRemarkupTable() take some extra parameters.

We don't currently do (much) HTML parsing but since we're re-rendering all the HTML, not just passing it through, the peril associated with getting things wrong is relatively low and the parser does not need to be especially sophisticated or particularly good at handling failures / unexpected states.