Copy
The Column Issue
How to create HTML columns.
Peek at this email in your browser
Type E:

01. The Column Issue
Russell Square Underground Station.
Above: En route to Completely Email, London, Russell Square Underground Station features distinctive typography and tiling, designed by Leslie Green.

It’s often been a frustration of mine that we’ve never really had true multiple-column layouts on email, where text happily flows on from one column to the next. Instead we’ve hacked tables and table cells, like so many other elements, in order to give the impression of columns, but without their elegance or flexibility.
The Solution
 CSS3 provides a solution to this in the form of column-count, (along with column-rule and column-gap), which is best supported when applied to a <p> tag. Here’s how to go about implementing it in 3 simple steps.

Step 1: Specify the number of columns you would like by applying the column-count property to your <p> tag.

Wrapping your text within a pair of <p> tags, apply the CSS3 column-count property to the opening tag as follows:

<p style="column-count:2; -webkit-column-count:2; -moz-column-count:2;">

In addition to column-count, you’ll see that I’ve also added -webkit-column-count and -moz-column-count for email clients that use the Webkit and Gecko rendering engines. The value that follows the column-count property denotes how many columns your text will be divided into. You may of course wish to change the number of columns depending on the viewport, so in this example I’ve added a class to be referenced by a @media query:

<p class="columns" style="column-count:2; -webkit-column-count:2; -moz-column-count:2;">

I’ve then applied CSS rules within the @media query, in this case for 3 columns, as follows:

p[class="columns"] {column-count:3 !important; -webkit-column-count:3 !important; -moz-column-count:3 !important;}

Your text should now be divided into the number of columns you’ve specified, with an equal number of lines within each column. You’re now ready to divide your text into individual paragraphs, which is what we’ll look at in Step 2.



Type Anatomy
A.

Upper Case ‘A’
Font: Adobe Caslon Pro.

  1. Apex
  2. Crossbar


Step 2: Indent each new paragraph using the text-indent and display properties.

My usual practice when dividing text into paragraphs is to insert a pair of <br/> tags to create a full line space. This presents us with a challenge however, when we’re dealing with column-count. The reason for this, is that there is a risk that the line space might appear at the top of a column, giving us an uneven block of text. The solution then, is to indent the first line of each new paragraph. This is achieved by inserting a non-breaking space, containing it within a pair of <span> tags, and then styling it as follows:

<span class="indent" style="text-indent:30px; display:inline-block;">&nbsp;</span>

This piece of code indents the first line of text by 30px. You can specify your own dimension to suit your layout. Now we have our columns in place, we can look at the other two properties, column-rule and column-gap in Step 3.



Typographic Advent Calendar
Type & Lettering Advent Calendar.

Day 1.

If you’ve been following me on twitter, you’ll be aware of Type Worship’s Typographic Advent Calendar. This is day 1, by Andrei Robu.



Step 3: Apply column-rule and column-gap to your <p> tag.

Though column-rule and column-gap aren’t as well supported, they are still worth mentioning, and are pretty self explanatory. column-rule simply places a vertical rule between each column of text, and is styled much like a border, as shown in the following example:

column-rule:1px dotted #333333; -webkit-column-rule:1px dotted #333333; -moz-column-rule:1px dotted #333333;

All I have done here is create a 1px dotted rule, and applied the colour #333333;, and as with column-count, I’ve added support for email clients that use the Webkit and Gecko rendering engines. column-gap is even more simple. It specifies the width of the gap between each column of text, like so:

column-gap:12px;

Support for column-count is pretty good, as you can see on the following Litmus test results. As you’d expect, it is fully supported on iOS Mail and Apple Mail, but is also supported on some unlikely email and webmail clients. The real beauty of this though, is that it falls back extremely gracefully to a single column where support for column-count isn’t present.

Desktop SupportTablet / Mobile Support
Apple Mail 6iPad (All)
Outlook 2011iPhone (All)
ThunderbirdAndroid 2.3
AOL Mail (Explorer)Android 4.2
AOL Mail (Firefox)
AOL Mail (Chrome)
Outlook.com (Explorer)

Finally, it’s worth mentioning that column-count is also supported on the <td> tag, but to a lesser extent than <p>. It does have one advantage over the <p> tag however, in that being a block-level element, it allows you to include images within your columns. As always, the method you choose should always be informed by your data, and the email / webmail clients your subscribers use.


Type E: is an email newsletter devoted to typography on email, created by Email Designer and Developer, Paul Airy. Please email your thoughts, suggestions and questions to type-e@beyondtheenvelope.co.uk. Thank you for subscribing!



Beyond the Envelope™
© Paul Airy, 2014
+44 (0) 7962 177 477 (International)
07962 177 477 (UK)
Unsubscribe:
Though I’d be very sad to see you go! :(