# 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="https://2086102864-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIdHBGk8cqznUpEqm5g1U%2Fuploads%2FdDqpr2Wjrim8gherLk77%2F2022-10-20_16h29_13.png?alt=media&#x26;token=cf4584f5-0f85-4ecd-92af-ebe7b0974342" 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="https://2086102864-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIdHBGk8cqznUpEqm5g1U%2Fuploads%2Fd1k0CjQVwOhULmAG6BGt%2F2022-10-12_15h33_25.png?alt=media&#x26;token=2e4be077-4969-4675-911e-38a27d4bcd25" alt=""><figcaption></figcaption></figure>

####
