Skip to content

Leftovers from #1878: HTML import: table widths, cell colours, spans, borders and layout tables #1894

Open

Description

@yeroo

Leftovers from #1878 (PR #1893): minor review findings and plan items deferred by the loop.

  • p1 (minor, plan, docxcore/src/import/html_table.rs): HTML import: CSS borders on tables and cells
  • p2 (minor, plan, docxcore/src/import/html.rs): HTML import: row heights, col/colgroup widths, max-width
  • p3 (minor, plan, docxcore/src/import/html.rs): HTML import: centre a table under center / div align / margin:0 auto
  • p4 (minor, plan, docxcore/src/import/html.rs): HTML import: th default bold/centre, body and image backgrounds
p1

HTML import (#1878) reads only the border attribute of <table>. CSS border, border-top/right/bottom/left (and -width/-style/-color) on tables and cells are ignored, as are frame/rules, border-collapse and the bordercolor attribute. HTML emails often draw rules with border-bottom: 1px solid #eee on cells. Map them to tblBorders / tcBorders (docxcore/src/import/html.rs cascade, docxcore/src/import/html_table.rs tcPr/tblPr writers).

p2

HTML import (#1878): row/cell height (→ w:trHeight atLeast), <col>/<colgroup> width (→ grid columns), and CSS max-width on a table (the common width:100%;max-width:600px email shape) are not read. col/colgroup are void/ignored in docxcore/src/import/html.rs.

p3

HTML import (#1878) centres a table only from <table align=center|right>. A browser also centres it under <center>, <div align=center> (align descendants), and with CSS margin: 0 auto / margin-left:auto; margin-right:auto; that is how most email templates centre their 600px table. Map them to tblPr/w:jc.

p4

HTML import (#1878): th cells are not bold and centred by default as a browser's UA sheet makes them; a page/body bgcolor or background and table background images are not read.

Source: #1878, PR #1893
Severity: minor

Activity

  1. added
    follow-upfiled automatically by an agworkbench loop
    priority:P2correctness defect that blocks nothing open
    on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    follow-upfiled automatically by an agworkbench looppriority:P2correctness defect that blocks nothing open

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions