<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Bloggerrific &#187; tables</title>
	<atom:link href="http://www.davidjrush.com/blog/tag/tables/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.davidjrush.com</link>
	<description>David J. Rush is a web designer and usability consultant in Pittsburgh who freelances and blogs about anything web related.</description>
	<lastBuildDate>Thu, 05 Jan 2012 02:50:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Email Client Compatibility &#8211; HTML Friendly Emails</title>
		<link>http://www.davidjrush.com/blog/2011/05/email-client-compatibility-html-friendly-emails/</link>
		<comments>http://www.davidjrush.com/blog/2011/05/email-client-compatibility-html-friendly-emails/#comments</comments>
		<pubDate>Sat, 21 May 2011 05:00:49 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Browser Compatibility]]></category>
		<category><![CDATA[Email Campaigns]]></category>
		<category><![CDATA[HTML Tutorials]]></category>
		<category><![CDATA[Web and Graphic Design]]></category>
		<category><![CDATA[HTML emails]]></category>
		<category><![CDATA[learn HTML]]></category>
		<category><![CDATA[tables]]></category>

		<guid isPermaLink="false">http://www.davidjrush.com/blog/?p=328</guid>
		<description><![CDATA[As a web designer, I actually do not frequently find myself working with email designs. So when my employer requested some HTML email templates, I had to do some research. I found a fantastic article on HTML emails that really helped me out. It was a bit long though, and I discovered some additional things [...]]]></description>
			<content:encoded><![CDATA[<p>As a web designer, I actually do not frequently find myself working with email designs. So when my employer requested some HTML email templates, I had to do some research. I found a fantastic article on <a href="http://articles.sitepoint.com/article/code-html-email-newsletters" target="_blank">HTML emails</a> that really helped me out. It was a bit long though, and I discovered some additional things along the way that I thought I&#8217;d share.</p>
<p>The first thing you have to do as a web designer when working with HTML emails is forget everything you know about modern coding standards. HTML email is years behind the curve. You&#8217;ll find yourself using inline CSS with limited shortcuts, tables instead of divs, and even deprecated attributes that haven&#8217;t been used in years.</p>
<p>The second thing you have to do is settle on a simple design. If you thought <a href="http://www.davidjrush.com/blog/2009/02/cross-browser-testing/">cross-browser testing</a> was a miserable experience with four to five browsers (Safari, IE, Firefox, Chrome, and maybe Opera&#8230; plus mobile if you desire) try the dozens upon dozens of different email clients that all render differently! There are some good resources out there for cross-email-client compatibility testing such as <a href="http://www.campaignmonitor.com/testing/" target="_blank">Campaign Monitor</a> or <a href="http://litmus.com/email-previews" target="_blank">Litmus</a>, but most charge, and if they don&#8217;t, they have a lot of restrictions like frequency of checking.</p>
<p>So here are the secrets to making your emails look good across all of your major email clients:</p>
<p><strong>1. Use Tables For Layout</strong> because floating and positioning doesn&#8217;t work all that well. If you need something to appear next to another item (such as an image next to text) you should still divide that up into two tables. I know I know, it goes against everything you&#8217;ve ever known about modern coding standards and practices. But trust me, it&#8217;s the best way to go.</p>
<p><strong>2. Use Inline CSS Only</strong> unless you don&#8217;t want your emails to all look the same. Some email clients will strip out the head tag or any external style sheet references, and others anything within a style tag. Keep in mind, many of these email clients are browser based, meaning they have their own custom CSS. To protect that CSS, they&#8217;ll strip anything out that could interfere with it before displaying it. And don&#8217;t even think about javascript&#8230;</p>
<p><strong>3. Don&#8217;t Shy Away From Deprecated Attributes</strong> like width and border for your tables. When in doubt, just include it, because W3C standards do not really apply in the same way for emails as they do for websites. I always double my declarations. If I want my table to have no border, then I put that in my inline style declaration, and as a border=&quot;0&quot; within the tag.</p>
<p><strong>4. Avoid CSS Shorthand</strong> like &quot;font: 14px Arial;&quot; and instead do it longhand like &quot;font-family: Arial; font-size: 14px;&quot;. Some email clients won&#8217;t read the shorthand CSS, though admittedly a majority do.</p>
<p>Here&#8217;s a bare, one column template that you can use with a single h1, h2, p, and a tag. Notice the XX and YY for your own personal preferences. The 98% width on the main table prevents email client bugs that create horizontal scroll bars.:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;html&gt;&lt;body&gt;
&lt;table style=&quot;width: 98%;&quot;&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot; align=&quot;center&quot;&gt;
&lt;table style=&quot;width: YYpx;&quot;&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;
&lt;table width=&quot;YY&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;
  &lt;tr&gt;
    &lt;td style=&quot;width: 600px;&quot; valign=&quot;top&quot;&gt;
      Header Content Goes In Here
    &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td style=&quot;width: YYpx;&quot; align=&quot;left&quot; valign=&quot;top&quot;&gt;
      &lt;h1 style=&quot;font-size: XXpx; color: #XXXXXX;
        font-family: XX; margin: XXpx XXpx XXpx XXpx;&quot;&gt;Enter Your Header Here&lt;/h1&gt;
      &lt;h2 style=&quot;font-size: XXpx; color: #XXXXXX;
        font-family: XX; margin: XXpx XXpx XXpx XXpx;&quot;&gt;Enter Your Subheader Here&lt;/h2&gt;
      &lt;p style=&quot;font-size: XXpx; color: #XXXXXX; font-family: XX;
        margin: XXpx XXpx XXpx XXpx;&quot;&gt;Enter Your Main Content Here&lt;/p&gt;
      &lt;a href=&quot;&quot; target=&quot;_blank&quot; style=&quot;font-size: XXpx; color: #XXXXXX;
        font-family: XX; margin: XXpx XXpx XXpx XXpx;&quot;&gt;Enter Your Link Here&lt;/a&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td style=&quot;width: YYpx;&quot; valign=&quot;top&quot;&gt;
      Footer Content Goes In Here
    &lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/body&gt;&lt;/html&gt;
</pre>
<p>In a future post, I&#8217;ll discuss ways to avoid getting your email marked as spam, as well as other best practices for making a good marketing email.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidjrush.com/blog/2011/05/email-client-compatibility-html-friendly-emails/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Pros and Cons of Tables</title>
		<link>http://www.davidjrush.com/blog/2009/02/the-pros-and-cons-of-tables/</link>
		<comments>http://www.davidjrush.com/blog/2009/02/the-pros-and-cons-of-tables/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 13:00:00 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[HTML Tutorials]]></category>
		<category><![CDATA[css positioning]]></category>
		<category><![CDATA[learn HTML]]></category>
		<category><![CDATA[tables]]></category>
		<category><![CDATA[website layout]]></category>

		<guid isPermaLink="false">http://www.davidjrush.com/blog/?p=19</guid>
		<description><![CDATA[When I started my job as a fulltime web designer, I discovered that my boss used tables for everything. This wasn&#8217;t that surprising considering he is a back end developer as opposed to a front end designer. I of course yelled at him (in my mind so as not to get fired) about how horrible [...]]]></description>
			<content:encoded><![CDATA[<p>When I started my job as a fulltime web designer, I discovered that my boss used tables for everything. This wasn&#8217;t that surprising considering he is a back end developer as opposed to a front end designer. I of course yelled at him (in my mind so as not to get fired) about how horrible tables are. Since then, I&#8217;ve settled more in the middle, and I figured I should offer my two cents on the debate of Tables Versus CSS for layout purposes.</p>
<p>First let&#8217;s take a look at the oh-so-obvious faults of tables, and why these cons are such an issue.</p>
<p><span style="font-weight: bold;">Con 1. Tables are incredibly rigid.</span> Short of moving the content from one cell to another, changing the layout of anything within your table is incredibly difficult. Especially since you won&#8217;t want your layout to look like it uses a table, you&#8217;ll end up with rowspans and colspans everywhere.</p>
<p><span style="font-weight: bold;">Con 2. Table code can get messy. </span>If you use tables for all your layout, then you&#8217;ll end up with nested tables all over the place. The code becomes hard to read, and almost impossible to edit.</p>
<p><span style="font-weight: bold;">Con 3. Tables have different default settings in different browsers.</span> If you want your site to look the same no matter what browser your user is viewing it through, then you&#8217;ll have to go through at set padding, margin, border, et cetera to the values you want them to be. This is a hassle because of all the tags associated with tables. You&#8217;ve got table, tr, th, and td. Mind you, even if you don&#8217;t use tables, you should be setting default CSS values anyway to avoid cross-browser issues.</p>
<p><span style="font-weight: bold;">Con 4. Tables increase the size of your files.</span> That&#8217;s right. Tables just often require more code. Even though the difference in load time for most people is negligable, it is still something to consider.</p>
<p>Alright, and now the benefits of tables, and why it is important to set aside your bias against tables and accept these pros.</p>
<p><span style="font-weight: bold;">Pro 1. Tables can be very helpful for certain design elements.</span> Take rounded corners of any box for example. Though you&#8217;ll need anywhere between 1 and 8 images to make a rounded corner box (1 if the box does not need to expand, 3 if it expands in one direction, and 8 if it expands in two), tables will make the implementation of this a lot easier. Of course, you can use divs for this, but you won&#8217;t need to edit this table, just the content and images inside. Divs can float incorrectly in different browsers, ruining your rounded corner box, but the table won&#8217;t break.</p>
<p><span style="font-weight: bold;">Pro 2. Tables are great when you need to show&#8230; tables.</span> That&#8217;s right, sometimes the best way to display information is in a table, and obviously the best way to implement that in the web is using&#8230; you guessed it, a table!</p>
<p><span style="font-weight: bold;">Pro 3. Tables make certain difficult CSS issues much easier.</span> With tables, you can easily vertically center text, or ensure that two separate sentences of text will always appear next to each other horizontally. Obviously, there are tricks in CSS around this anyway. To vertically center a line of text, you can set the line-height to the same pixel height as the div it is in. So clearly, there is always a way around this problem.</p>
<p>When it comes down to it, every pro or con you find for tables doesn&#8217;t really matter. For every pro, using a little CSS magic, you can work around it. For every con, using a little effort or time can work around it too.</p>
<p>In the end, using floating divs is a much safer route to go for your layout. You can change the location of content very easily, your code will be cleaner, and make more sense logically when reading through it. But don&#8217;t knock down tables. Use tables for your overarching page layout (header, body, footer for example). These things won&#8217;t change as much, so tables are a clean and safe solution. Basically, tables aren&#8217;t 100% evil or amazing. Use them when appropriate, and don&#8217;t overdo it, and you&#8217;ll be just fine.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidjrush.com/blog/2009/02/the-pros-and-cons-of-tables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

