# Email With Columns

The classic html email design lays out articles and content in rows. This makes compatibility a breeze and simplifies using data-driven email tools such as FeedOtter.

However, many modern newsletters and email journals prefer to design html emails with columns of content.  There are some special considerations when designing a column-based template for use with FeedOtter.

## Basic Example

A basic example which will layout columns of content.

```html
<!--## [% if feedotter.posts is not empty %] ##-->
<table width="100%"><tr><td width="100%">
	<!--## [% for row in feedotter.posts  | batch(2) %] ##-->
	<tr>
		<!--## [% for post in row|slice(0,1) %] ##-->
		<td>
			//column 1 content
		[[post.post_title]]
		</td>
		<!--## [% endfor %] ##-->
		
		<!--## [% for post in row|slice(1,1) %] ##-->
		<td>
		//column 2 content
		[[post.post_title]]
		</td>
		<!--## [% endfor %] ##-->
	</tr>
	<!--## [% endfor %] ##-->
</td></tr><table>
<!--## [% endif %] ##-->
```

You'll only need to code 1 row of a column layout.  FeedOtter will repeat the row based on the amount of content in your email.

Here's what the code listed above displays in FeedOtter when their are 6 posts available to display.  3 rows of 2 columns each.

<figure><img src="/files/AcX4a0hd5kkMxKPL1U1P" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
The **batch** filter on the feedotter.posts loop creates subloops of content divided by the number provided. In this case 2.
{% endhint %}

{% hint style="warning" %}
When using columns it is important that you always supply enough content to fulfill all columns in the design.  If we provided 5 posts to the above design it would likely look terrible when tested in Litmus because column responsiveness is near impossible to create in html email.
{% endhint %}

Use the FeedOtter interface and the Max Posts value to adjust the number of posts displayed in your email.&#x20;

<figure><img src="/files/6baP08iGuZmJfthMCVvH" alt=""><figcaption></figcaption></figure>

####


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.feedotter.com/set-up-your-own-template/advanced-template-information/email-with-columns.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
