Spacing issue when deleting certain elements in layout

Hi all,

Here is a sample layout of what I am trying to accomplish:

<table border="0" cellspacing="0" cellpadding="0" width="97%">
  <tr>
    <td align="left" class="title"><singleline label="Title" repeatertitle="true">Title</singleline></td>
  </tr>
  <tr>
    <td align="left" class="subtitle"><strong><singleline label="Title">Subtitle</singleline></strong></td>
  </tr>
  <tr>
    <td align="left" class="mainBody"><multiline label="Description">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</multiline></td>
  </tr>
  <tr>
    <td align="left" style="padding-left: 20px;"><img src="images/banner-left.jpg" width="408" height="154" editable="true" label="Image" /></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
              </table>

Currently the subtitle is really close to the main title and I want to add some spacing above the subtitle. If I add some padding to the subtitle cell this would work out fine, but if for some reason the user doesn't want a subtitle and they delete the text, the table cell padding stays there and there is some extra unwanted space between the title and content. If I add a table row above the subtitle, this looks fine as well but again if the user deletes the subtitle text there is that unwanted space.

Is there any way to add some padding to each element but have it get deleted as well as the text?

Any help would be appreciated.

Thanks!

Chris

oneblackcrayon oneblackcrayon, 5 years ago

Hi!
Try the following code to see if this helps with your issue.
Also, stay away from using padding as Outlook 2007 & 2010 doesn't recognize it.


<table align="center" border="0" cellspacing="0" cellpadding="0" width="97%">
    <tr>
        <td>
            <repeater>
                <h2><singleline label="Title" repeatertitle="true">Title</singleline></h2>
                <h3><singleline label="Title">Subtitle</singleline></h3>
                <multiline label="Description"><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p></multiline>
                <img src="http://placehold.it/408x154/CCCCCC/FAFAFA" width="408" editable="true" label="image">
            </repeater>
        </td>
    </tr>
</table>
Mindsplit, 5 years ago

Hi,

Thanks for the help. I will definitely use this new way of laying this out.

In terms of padding, I have always used padding in table cells and have never had an issue. The emails look fine to me in Outlook 2010. On this page ( http://www.campaignmonitor.com/css/  ) it says padding is accepted by all clients except Outlook doesn't like padding on the p and div tags (which I am not using here). Is there something I am missing?

Thanks again for the help.

Chris

oneblackcrayon oneblackcrayon, 5 years ago

I have had issues with padding on TDs & Tables. I will check out the CSS link and see what I am missing.
Did the code help?

Mindsplit, 5 years ago

It's the end of the day here and I am headed home but yes I am going to get rid of the table cells and use this easier layout. I already tested it a bit and it seemed to remove all the spacing I previously had.

Thanks again!

Chris

Join 200,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free
1-888-533-8098