Skip to content

Recipe: lists and tables

This recipe builds a Dunder Mifflin supplies list: a header row, one row per supply with its item and quantity, and a total right under the last row.

You’ll learn list variables and their item fields, the Repeat of a group (the for of a template), and how a column that hugs lets repeated rows push down what follows.

It continues Layouts with groups: the list goes in a column with Hug and Stretch, like the body of the card there.

The supplies list: one repeated row per supply, and the total under the last row

A group with Repeat is drawn once per item of a list. Each copy is a sibling, placed by the parent’s layout. In a column that hugs, the copies stack and the column grows with them, pushing down whatever follows it.

header
supplies.item ⟳
In the editor: one copy
header
A4 copy paper
Letterhead
Envelopes
Business cards (500)
In the PDF: one copy per item

Inside a copy, texts read the fields of the current item: supplies.item, supplies.quantity. Angela types the list once, and the repeat turns every supply into its own row.

On My Templates, click New Template. Name it Supplies list, choose A4 portrait and click Create.

Click Variables → Add Variable:

  • Name: supplies, Type: List.

  • Max Items: 12, the number of rows the page has room for.

  • Item Fields:

    Field Type Max length Required
    item String 40 ✅
    quantity String 8 ✅
  • Default Value: two or three sample rows, such as A4 copy paper and envelopes. Preview starts from them.

Then add a total variable: String, required, max length 20.

The title, the subtitle and the table go in one column that stacks them from the top.

  1. Pick Add group and draw a group over the whole page, with a margin of about 80 on each side. Rename it Page, make it a Column, click Stretch and set a Gap of 24. Leave Hug off: this column keeps the page’s size, and the table inside it is what grows.

  2. Draw two text boxes in it: DUNDER MIFFLIN in bold, 44, and Office supplies list in 28, grey. The column stacks them at the top.

The structure:

Page Column · Stretch · Gap 24
├─ Title, subtitle
└─ Table Column · Hug · Stretch
├─ Header row Row · Stretch · height 56 · Padding 0 16 · Gap 16 · dark fill
│ ├─ Item text · Flex 1
│ └─ Quantity text · width 160 · right-aligned
├─ Supply row the same row, light · ⟳ Repeat: supplies
│ ├─ supplies.item
│ └─ supplies.quantity
└─ Total row Row · justify end · middle · Gap 24 · Padding 0 16 · height 64
  1. Draw the table: a group in the free space of Page, under the subtitle, about 400 high so you have room to draw rows in. Make it a Column and click Stretch. Leave Hug off until the rows are in: an empty hugging column with no padding has no height left to draw in. Rename it Table.

  2. Draw the header row: a group inside the table, 56 high. Make it a Row, click Stretch, and set a Padding of 16 left and right, a Gap of 16, and a dark Fill.

  3. Draw two text boxes in the row for the header cells, and type Item and Quantity, bold, white. Give Item Flex 1, give Quantity a fixed width of 160 and right-align it, and set both to middle vertical alignment.

  4. For the supply row, select the header row and press Ctrl+D. The duplicate keeps the cell widths, so the columns stay aligned. Clear its fill, give it a 1-point bottom border (Stroke, bottom side only), and set the text to regular, dark.

  5. With the supply row selected, click Repeat and pick supplies under Lists. The button reads Repeat: supplies, and a ⟳ badge marks the row.

  6. In each cell of that row, delete the header text, click Variable (⚡) and pick supplies.item and supplies.quantity. Item fields are only offered inside the repeated group.

  7. Select the table and turn on Hug. It shrinks to its two rows, and from now on its height follows them.

  1. Draw a group in the free space under the table and rename it Total row. Make it a Row, packed at the right of the alignment grid, middle, Gap 24, 64 high, with a Padding of 16 left and right like the table rows.

  2. Put a TOTAL text in it, then a text holding total, 160 wide and right-aligned like the quantity cells, so the total lines up under the quantities.

  3. In the layers panel, drag the Total row row onto the middle of the Table row. The total row joins the table after the supply row, and the table grows to hold it.

The table hugs, so its height follows its rows, and the total row at its end moves down with every supply. To check it, click Preview and add rows to supplies in the Variable Values form: with three rows or with ten, the total sits right under the last one.