Overview
The columns element allows you to create multi-column layouts in your notifications. It acts as a container for a row of columns, enabling side-by-side content organization. Each column can have independent styling, width, and content. When to use:- Create side-by-side layouts (e.g., product images with descriptions)
- Build responsive multi-column grids
- Organize content in structured layouts
- Display data in tabular-like formats
Email Client Compatibility: Column styling uses MJML patterns for maximum email client compatibility. Border radius and borders render correctly in most modern email clients, with graceful degradation in older clients. The
gap property automatically calculates proper spacing by inserting spacer columns between content columns.Basic Example
Columns Element Fields
The type of element. For columns elements, this value must be
"columns".An array of column elements. Each element must be of type
"column". See the Column Element section below for column properties.Background color for the columns container. Can be any valid CSS color value (e.g.,
"#f5f5f5", "rgb(245,245,245)").Border width for the columns container (e.g.,
"1px", "2px").Border color for the columns container (e.g.,
"#cccccc", "rgb(204,204,204)").Border radius for rounded corners on the container (e.g.,
"5px", "10px").Spacing between columns. Automatically inserts spacer columns with exact width (e.g.,
"10px", "15px").Inner padding for the entire columns container. Can use CSS shorthand (e.g.,
"10px", "20px 10px").Alignment of columns within the row. One of
"top", "middle", or "bottom". Defaults to "top".Column Element
Each child in theelements array of a columns element must be of type column. This allows for independent styling and width control for each column.
Column Fields
The type of element. For column elements, this value must be
"column".The content blocks inside this specific column. Can include any Elemental elements (text, image, action, etc.).
The width of the column. Can be:
- Percentage:
"50%","33.33%" - Fixed:
"200px","300px" - Auto:
"auto"(takes remaining space)
Hex code or CSS color for the column background (e.g.,
"#F4F7FF", "rgb(244,247,255)").Border width for this specific column (e.g.,
"1px", "2px").Border color for this specific column (e.g.,
"#cccccc", "rgb(204,204,204)").Border radius for rounded corners on this column (e.g.,
"5px", "10px").CSS padding shorthand for the column (e.g.,
"10px", "20px 10px").Overrides the parent’s vertical alignment for this specific column. One of
"top", "middle", or "bottom".Examples & Variants
Two-Column Layout
Basic sidebar and main content layout:Equal-Width Columns
Three equal columns with middle vertical alignment:Styled Container with Borders
Columns container with styling:Individual Column Styling
Each column with its own styling:Product Card Layout
Complete product card with image and details:Best Practices
- Use percentages for widths: Percentages work better across different screen sizes than fixed widths
- Keep column count reasonable: 2-3 columns work best for email; more columns can be cramped
- Test responsive behavior: Columns stack on mobile devices, so ensure content works in single-column view
- Use gap for spacing: The
gapproperty provides consistent spacing between columns - Consider vertical alignment: Use
vertical_alignto align content when columns have different heights
Channel Support
- Email: Full support with MJML rendering for maximum compatibility
- Push: Limited support; columns may render as stacked content
- SMS: Not supported; use single-column layouts
- Inbox: Full support with responsive behavior
Related Elements
- Text Element - For text content within columns
- Image Element - For images within columns
- Action Element - For buttons and links within columns
- Group Element - For grouping elements within columns
- Control Flow - For conditional columns and loops