Skip to content

Block Attributes

All attributes available on block-level elements (frame, page, table, td, th, etc.).

Sizing

AttributeTypeDefaultDescription
widthpt, cm, %, fill, autoautoElement width
heightpt, cm, %, fill, autoautoElement height
min-widthpt, cm, %--Minimum width constraint
max-widthpt, cm, %--Maximum width constraint
min-heightpt, cm, %--Minimum height constraint
max-heightpt, cm, %--Maximum height constraint

Layout

AttributeTypeDefaultDescription
directioncolumn, col, rowcolumnChild stacking direction
h-alignleft, center, rightleftHorizontal alignment of content
v-aligntop, center, bottomtopVertical alignment of content
text-alignleft, right, center, justifyleftText alignment within element

Spacing

AttributeTypeDefaultDescription
paddingpt, cm0Padding on all sides
padding-toppt, cm0Top padding
padding-bottompt, cm0Bottom padding
padding-leftpt, cm0Left padding
padding-rightpt, cm0Right padding
space-before-desiredpt, cm0Desired space above (compressed at page boundaries)
space-after-desiredpt, cm0Desired space below (compressed at page boundaries)

Positioning

AttributeTypeDefaultDescription
toppt, cm--Absolute offset from parent top
bottompt, cm--Absolute offset from parent bottom
leftpt, cm--Absolute offset from parent left
rightpt, cm--Absolute offset from parent right

Borders

AttributeTypeDefaultDescription
border-weightpt0Border width on all sides
border-weight-toppt--Top border width
border-weight-bottompt--Bottom border width
border-weight-leftpt--Left border width
border-weight-rightpt--Right border width
border-colorcolour--Border colour on all sides
border-color-topcolour--Top border colour
border-color-bottomcolour--Bottom border colour
border-color-leftcolour--Left border colour
border-color-rightcolour--Right border colour
border-radiuspt0Corner radius on all corners
border-radius-tpt--Top-left and top-right radius
border-radius-bpt--Bottom-left and bottom-right radius
border-radius-lpt--Top-left and bottom-left radius
border-radius-rpt--Top-right and bottom-right radius
border-radius-tlpt--Top-left corner radius
border-radius-trpt--Top-right corner radius
border-radius-blpt--Bottom-left corner radius
border-radius-brpt--Bottom-right corner radius

Appearance

AttributeTypeDefaultDescription
background-colorcolour--Background fill colour
rotation90, 180, 270--Clockwise rotation in degrees
page-rotation0, 90, 180, 270--Requests that the containing page be rendered rotated clockwise by this many degrees. Set on any descendant — Papermill rotates the whole page at emission. See Page rotation.

Breaking

AttributeTypeDefaultDescription
breakauto, neverautoPage breaking behaviour
break-beforeauto, frameautoForce a frame break before this element
prevent-lasttrue, falsefalsePrevent item being last in frame, breaking to next
orphan-lines-thresholdnumber--Minimum lines before allowing a break

Text

AttributeTypeDefaultDescription
text-transformuppercase, lowercase, capitalize, upper, lower, title--Text case transformation (inherited by children)
caseAlias for text-transform--Text case transformation (inherited by children)

Conditional and Identity

AttributeTypeDefaultDescription
show-ifdata path--Render only when condition is truthy
idstring--Unique element identifier
targetstring--Link to element with matching id (internal link)
outlinestring--Add to named outline collection
levelnumber--Hierarchy level in outline
style@alias-name, property=value--Apply a style alias

Page-Specific

AttributeTypeDefaultDescription
formatA0-A10, A0-landscape-A10-landscape--Named page format
orientationportrait, landscapeportraitWhether to swap page format width and height
page-marginpt, cm0Page margin on all sides
page-margin-toppt, cm--Top page margin
page-margin-bottompt, cm--Bottom page margin
page-margin-leftpt, cm--Left page margin
page-margin-rightpt, cm--Right page margin
repeattrue, falsefalseRepeat page for flow content
flowflow name--Flow that controls page repetition
deferredtrue, falsefalseAllow access to <repeat outline="">
namedata expression--Dynamic page type selection

Table-Specific

AttributeTypeDefaultDescription
colspannumber1Number of columns a cell spans (on td/th)

Page rotation

page-rotation is a per-element attribute that requests the whole page containing the element be rendered rotated by the given number of degrees clockwise. Allowed values are 0, 90, 180, 270; 0 is the same as omitting the attribute.

Unlike rotation, which rotates an element within its frame, page-rotation does not affect how the page is laid out — content fits the same way it would on a non-rotated page, and the document outline, page numbers, and cross-references continue to point at the same logical page. The rotation is a property of the rendered page.

press
<styles>
  <alias name="wide-tables">
    <padding>6pt</padding>
    <child name="table" apply-if="breaks('width')">
      <rotation>270</rotation>
      <page-rotation>90</page-rotation>
    </child>
    <child name="table">
      <width>100%</width>
      <font-size>8pt</font-size>
    </child>
  </alias>
</styles>

In this example a wide table that doesn't fit the page width is rotated 270° so it lays out vertically in the available column, and the whole page is rotated 90° so the upright table reads the right way up on the rendered landscape page. The two attributes compose: rotation makes a single element fit; page-rotation makes the page read the right way up.

Precedence

If more than one element on the same page requests a page-rotation, every non-zero request must agree. Conflicting values (e.g. one element asking for 90 while another asks for 270) are an authoring error — Papermill rejects the document with message Conflicting <page-rotation> values on the same page listing the conflicting source locations. This avoids "first wins" / "last wins" becoming a non-local surprise where reordering unrelated content changes the rendered orientation.

Composition

page-rotation is not inherited through component composition: a component that sets page-rotation internally does not pass the request to siblings outside the component unless they happen to live on the same page.