Skip to content

valign attribute / vertical-align on table cells is not supported #508

Description

@KaiserKarel

Related to #507 (same real-world emails). Table cells have no vertical alignment support: the servo-mode stylo build doesn't include the vertical-align longhand at all, and blitz doesn't map the valign presentational attribute either. Cell content always flows from the top.

Real-world impact

HTML-email bar charts (Sentry weekly reports and similar) build columns as <td valign="bottom" style="height:110px"> containing a shorter bar table — without valign, every bar hangs from the top and the chart renders upside down.

Minimal repro

<table style="width:100px"><tr>
  <td valign="bottom" style="height:110px;font-size:0">
    <table style="width:100%"><tr>
      <td height="55" style="background-color:#7553FF;font-size:0">&#160;</td>
    </tr></table>
  </td>
</tr></table>

Expected: purple block in the bottom half of the 110px column. Actual: top half.

Approach we took

Since taffy 0.12's block layout supports align-content, we map the cell's valign attribute onto the cell's inner block style (bottomAlignContent::END, middle/centerCENTER, topSTART) at taffy-style build time: fifteenlabs/blitz@244abec. That sidesteps the missing stylo longhand; a fuller fix would add vertical-align to the stylo property set. Happy to upstream the attribute-level version if useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions