xhmtl2pdf supports only limited number of css properties as described in the docs page:
background-color
border-bottom-color, border-bottom-style, border-bottom-width
border-left-color, border-left-style, border-left-width
border-right-color, border-right-style, border-right-width
border-top-color, border-top-style, border-top-width
colordisplay
font-family, font-size, font-style, font-weight
height
line-height, list-style-type
margin-bottom, margin-left, margin-right, margin-top
padding-bottom, padding-left, padding-right, padding-top
page-break-after, page-break-before
size
text-align, text-decoration, text-indent
vertical-align
white-space
width
zoom
And adds few of its own for defining its own styling:
-pdf-frame-border
-pdf-frame-break
-pdf-frame-content
-pdf-keep-with-next
-pdf-next-page
-pdf-outline
-pdf-outline-level
-pdf-outline-open
-pdf-page-break
Namely it does not accept flex
, border-collapse
and border-spacing
from your code.
Use its pages and frames to define layout instead of flex columns.
Also doc says that it has some default styling for the page, which you may dump, edit or replace like described here:
# dump
$ xhtml2pdf --css-dump > xhtml2pdf-default.css
# replace
$ xhtml2pdf --css=xhtml2pdf-default.css test.html
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…