You will learn

Learn how to use a table block in an email. These blocks can display images and text side by side. Table blocks can also be dynamic, iterating over data to personalize the email to each recipient.

Understanding table blocks

There are 2 types of table blocks:

  • Static
    This type of table block displays the exact number of rows and columns you select. Each recipient sees the same table layout, but the content could vary if you use personalization, event, catalog, or other tags.
  • Dynamic
    These table blocks allow you to iterate over a list of data (e.g., a list of items in an abandoned cart or order confirmation flow). The number of rows is determined by the number of list items: if someone ordered 1 item, they will have 1 row; if they ordered 5 items, they’ll have 5 rows.

The most common use case for a dynamic table block is highlighting products in an abandoned cart message. This uses a dynamic block to display multiple rows with images, product names, and prices of each abandoned item.

When to use table blocks

A table block is one of several ways to put 2 or more pieces of content side by side. Alternatives include split blocks and columns.

Learn more about the different options to place content side by side in the table below.

Content layout

Number of columns

Width options

Allowed content types

Can columns stack on mobile view?

Split block

2

Precise control (Use Styles > Layout, then Col 1 width and Col 2 width)

Text or images

Yes

Columns

1-4

Limited selection

Any type of content block (e.g., text block, image block, review quote block)

Yes

Table block

Any number

Precise control (Use Column width > Manual)

Text or images

No

Tables can be challenging for accessibility, as screen readers have a hard time parsing them.

Static table blocks

The word “static” here simply means the content and number of rows in the table stays the same for every recipient. The only time the content changes is if you add dynamic content, like personalization, date, and catalog tags, within a static table block.

Use cases for static table blocks

Use a static table block to:

  • Show a specific item, such as for flash sales or product launches.
  • Always include the same number of items (e.g., show the most recently viewed item in a browse abandonment message).
  • Create a flow message where the event data only contains 1 item, which includes:
    • Abandoned cart flows (added to cart trigger)
    • Browse abandonment flows
    • Back in stock and price drop flows
  • Place static text and images side by side.

How to create a static table block

  1. Navigate to an email (i.e., a campaign email, template, or flow email).
  2. From the Blocks menu, drag a Table block into the canvas.
The table block icon
The table block icon
  1. Open the Styles menu for the block. Note that Static is already selected, as this is the default setting for table blocks.
The block's styles menu
The block's styles menu
  1. Under Columns, click Add column to add additional columns.
The Add columns option
The Add columns option
  1. Under Rows, click Add row to add additional rows.
The Add row option
The Add row option
  1. Return to the block’s Content tab.
  2. Use the Cell selector area to choose which cell you’d like to edit.
The Cell selection area
The Cell selection area
  1. Choose Text or Image for the selected cell under Cell content.
  2. For a text cell, double-click the cell in the email canvas and enter your text. For an image cell, add an image under Cell image. Repeat these steps for each cell.
  3. Once you’ve added content to every cell, click the back arrow to return to the main Content menu and continue building your email.
The main Content menu
The main Content menu
  1. Click Preview to check the table on desktop and mobile.

Dynamic table blocks

If your ecommerce platform has a standard integration with Klaviyo, you do not need to build a dynamic table block. Instead, use the table blocks found in the default abandoned cart or placed order flows found in the flow library.

Dynamic table blocks iterate over a data set to repeat content based on the number of entries within it. The block iterates until it reaches the end of the list. For example, you can show the exact number of products in someone’s cart.

In order to use a dynamic block, you must reference data formatted as a nested list, where each list entry follows the same format. The most common use case is product information found in a flow’s trigger event (e.g., started checkout, placed order), but you can also use a web feed to list blog posts, or reference profile data that’s formatted as a list.

Elements of a dynamic table block

Creating a dynamic content block requires 3 elements:

  • Row collection
    The location of the data to iterate over. When looking at your source data (e.g., the items in a Started Checkout event’s metadata), this is the portion of the relevant template tags that is the same for every tag.
  • Row alias
    A short name for the current item as the table iterates through your data set. Use a single word, such as item, and use that same alias in the tags for your repeating content.
  • Dynamic content
    The content that will appear in every row. For example, you may want to display an image, product name, price, and variant information for every item someone left in their cart.

Use cases for dynamic table blocks

Use a dynamic table block if you’re dynamically referencing a list of data and every entry in the list is formatted in the same way. This includes:

  • Abandoned cart flows (checkout started trigger)
  • Order confirmation flows
  • Up- or cross-sell flows

How to create a dynamic table block

All tags used in these instructions are examples, and likely differ from the correct tags for your account. The correct tags for your message depend on your data’s source and structure (often an ecommerce platform), which is different for many Klaviyo accounts.

This section covers dynamic table blocks at a high level. For more detailed instructions on this process, learn how to build dynamic blocks in a flow email.

  1. Navigate to the editor for an email. If you are using event data (e.g., abandoned cart details), navigate to an email within a flow triggered by the relevant event.
  2. If you’re using event data, click Preview and select a recent event for the flow’s trigger that contains the items you want to display. Under Event properties, click the properties you need to copy their tags, then close the preview to return to the editor.
  3. From the Blocks menu, drag a Table block into the canvas.
The table block option
The table block option
  1. Open the Styles menu for the block and select Dynamic.
The Styles menu within a table block
The Styles menu within a table block
  1. Set your Row collection: enter the path to the list you want to repeat, without curly brackets. Omit the dot and item number immediately after the list’s name.
    • For example, if {{ event.products.0.imageURL }} is the tag for the first item’s image, and {{ event.products.1.name }} is the tag for the second item’s name, then your row collection should be event.products.
    • The row collection will almost always be the portion of the tag preceding the first number (e.g., event.extra.line_items if the full tag is {{ event.extra.line_items.0.product.name }}).
  2. Set your Row alias as item.
  3. Return to the block’s Content tab.
    • Add content to each cell of the table. Generally, the cell on the left is an image, and the cell on the right is text containing dynamic tags with product information. Double-click a text cell in the email canvas to edit its text. For an image cell, use the image URL tag as a dynamic image under Cell image.
  4. In each tag for an item in your row collection, replace the collection path and the following dot and item number with your row alias (e.g., item). Keep the remaining property path and curly brackets. For example:
    • {{ event.extra.line_items.0.imageURL }} becomes {{ item.imageURL }}
    • {{ event.items.0.product.name }} becomes {{ item.product.name }}
  5. Click Preview to preview your email.
    • Choose preview data that contains your row collection (e.g., a recent Started Checkout event for an abandoned cart message). Check that each item’s image and details appear correctly. If no rows appear, check the selected data, Row collection, Row alias, and the tags in your cells.

This process allows developers and code-savvy marketers to create highly customized content. If you don't have a developer on your team and are not comfortable creating this block yourself, consider reaching out to a Klaviyo Partner for assistance.

Learn more about creating an abandoned cart flow or using event data to personalize email and SMS flows.

How dynamic table blocks work

Dynamic table blocks work exactly like a for loop in most programming languages.

  • The Row collection identifies the portion of the data to loop through.
  • The Row alias identifies the current item in the row collection.
  • Every tag that uses the Row alias will reference the correct line within the event data, based on which row it appears in.

When the email is rendered, Klaviyo loops through each item in the data set. The first time, the row alias is replaced with [row collection].0., referencing the first item in the data set. The second time, the row alias is replaced with [row collection].1., indicating the second item in the data set. This process then continues until no items remain, and there is one row for every item in the data set.

Additional resources

Was this article helpful?
Use this form only for article feedback. Learn how to contact support.

Explore more from Klaviyo

Community
Connect with peers, partners, and Klaviyo experts to find inspiration, share insights, and get answers to all of your questions.
Partners
Hire a Klaviyo-certified expert to help you with a specific task, or for ongoing marketing management.
Support

Access support through your account.

Email support (free trial and paid accounts) Available 24/7

Chat/virtual assistance
Availability varies by location and plan type