Answers.Body: <p>A big Thank-You to Karen with Greenleaf Advancement for helping me out with this.</p>
  
  <p>There is a bug in Civi that does not allow the Table Cell separator to function. Karen helped we with some base code that works around the issue, I was able to tweek it from there to work for our situation. Paste the code in the Source of the letter. We use Line Items with all our donations. You will have to re-work the code a little if you do not use Price Sets. You may also want some additional columns ore in a different order. Just edit the code to your liking.</p>
  
  <pre><code>    &lt;table align="left" cellpadding="4" cellspacing="0" class="table" style="width: 700px;border: 1px solid #281c1d;"&gt;
      &lt;tbody&gt;
          &lt;tr style="padding: 8px; border: 1px solid #281c1d;color:white; background-color: #70551F;"&gt;
              &lt;th style="padding: 8px;"&gt;Date&lt;/th&gt;
              &lt;th style="padding: 8px;"&gt;Cont ID&lt;/th&gt;
              &lt;th style="padding: 8px;"&gt;Contribution Designation&lt;/th&gt;
              &lt;th style="padding: 8px;"&gt;Amount&lt;/th&gt;
          &lt;/tr&gt;
          &lt;!--
  
      {foreach from=$contributions item=contribution} {assign
      var="date" value=$contribution.receive_date|date_format:"%B %d %Y"}
  {crmAPI var='result' entity='LineItem' action='get' contribution_id=$contribution.id} 
    {foreach from=$result.values item=lineitem} 
  
    --&gt;
          &lt;tr style="padding: 4px; border: 1px solid #281c1d;"&gt;
              &lt;td style="padding: 4px; border: 1px solid #281c1d;"&gt;{$date}&lt;/td&gt;
              &lt;td style="padding: 4px; border: 1px solid #281c1d;"&gt;{$contribution.id}&lt;/td&gt;
              &lt;td style="padding: 4px; border: 1px solid #281c1d;"&gt;{$lineitem.label}&lt;/td&gt;
              &lt;td style="text-align:right;padding: 4px; border: 1px solid #281c1d;"&gt;$ {$lineitem.line_total}&lt;/td&gt;
          &lt;/tr&gt;
          &lt;!--
      {/foreach}{/foreach}
  
   --&gt;
          &lt;tr style="padding: 4px; border: 1px solid #281c1d;text-align:right;padding-top:20px;"&gt;
              &lt;th colspan="3" style="padding: 4px; border: 1px solid #281c1d;text-align:right;padding-top:20px;padding-right:20px;"&gt;2016 Total Contributions&lt;/th&gt;
              &lt;td style="padding-right: 4px; border: 1px solid #281c1d;padding-top:20px;text-align:right;"&gt;$ {$contribution_aggregate}.00&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-23T23:31:56.907Z
Answers.LastActivityDate: 2017-01-23T23:31:56.907Z
Answers.UserDisplayName: Iowa Boy
Answers.Body: <p>This patch (which is now part of core in 4.7) adds a linebreak option which makes it simple to create such tables</p>
  
  <p><a href="https://github.com/civicrm/civicrm-core/pull/8804/files" rel="nofollow noreferrer">https://github.com/civicrm/civicrm-core/pull/8804/files</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-24T03:30:25.800Z
Answers.LastActivityDate: 2017-01-24T03:30:25.800Z
Answers.UserDisplayName: Yossi
Body: <p>Civi 4.6.18 using WordPress</p>
  
  <p>I am working on creating a year-end statement for donors with all their donations for this year on it.  I am using the "Thank You letter" to do so.<br>
  1. I select Group by = Contact
  2. I select Separator = Table Cell.</p>
  
  <p>My results are Comma Separated. How do I get them into separate table cells?<br>
  <a href="https://i.sstatic.net/AJUTB.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/AJUTB.png" alt="Screenshot of results"></a></p>
  
  <p>Here is my source code for the letter.</p>
  
  <pre><code>&lt;p&gt;Dear {contact.first_name}&lt;/p&gt;
  
  &lt;p&gt;&amp;nbsp;&lt;/p&gt;
  
  &lt;table align="left" border="1" cellpadding="2" cellspacing="0" class="table" style="width: 500px;"&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;th&gt;Date&lt;/th&gt;
              &lt;th&gt;Amount&lt;/th&gt;
              &lt;th&gt;Receipt Number&lt;/th&gt;
          &lt;/tr&gt;
          &lt;!--
      {foreach from=$contributions item=contribution} {assign
      var="date" value=$contribution.receive_date|date_format:"%d %B
      %Y"}
    --&gt;
          &lt;tr&gt;
              &lt;td&gt;{contribution.receive_date}&lt;/td&gt;
              &lt;td&gt;{contribution.total_amount}&lt;/td&gt;
              &lt;td&gt;{contribution.contribution_id}&lt;/td&gt;
          &lt;/tr&gt;
          &lt;!--
      {/foreach}
  
   --&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>I got my original information from here. <a href="https://github.com/civicrm/civicrm-user-guide/blob/master/docs/contributions/manual-receipts-and-thank-yous.md" rel="nofollow noreferrer">https://github.com/civicrm/civicrm-user-guide/blob/master/docs/contributions/manual-receipts-and-thank-yous.md</a></p>
  
Tags: <system-workflow-messages>
Title: How do I use Table Cell Separator when creating Thank You letters?
ThreadText: # How do I use Table Cell Separator when creating Thank You letters?
  
  (Asked by: username_0 on 2016-10-19)
  
  Civi 4.6.18 using WordPress
  I am working on creating a year-end statement for donors with all their donations for this year on it.  I am using the "Thank You letter" to do so.
  1. I select Group by = Contact
  2. I select Separator = Table Cell.
  My results are Comma Separated. How do I get them into separate table cells?
  
  Here is my source code for the letter.
  Dear {contact.first_name}
  
   
  
  
      
          
              Date
              Amount
              Receipt Number
          
          
          
              {contribution.receive_date}
              {contribution.total_amount}
              {contribution.contribution_id}
          
          
      
  
  
  I got my original information from here. https://github.com/civicrm/civicrm-user-guide/blob/master/docs/contributions/manual-receipts-and-thank-yous.md
  
  **Tags:** system-workflow-messages
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2017-01-23. Score: 2
  
  A big Thank-You to Karen with Greenleaf Advancement for helping me out with this.
  There is a bug in Civi that does not allow the Table Cell separator to function. Karen helped we with some base code that works around the issue, I was able to tweek it from there to work for our situation. Paste the code in the Source of the letter. We use Line Items with all our donations. You will have to re-work the code a little if you do not use Price Sets. You may also want some additional columns ore in a different order. Just edit the code to your liking.
      
      
          
              Date
              Cont ID
              Contribution Designation
              Amount
          
          
          
              {$date}
              {$contribution.id}
              {$lineitem.label}
              $ {$lineitem.line_total}
          
          
          
              2016 Total Contributions
              $ {$contribution_aggregate}.00
  
  
  ---
  
  ### Answer by username_1 on 2017-01-24. Score: 1
  
  This patch (which is now part of core in 4.7) adds a linebreak option which makes it simple to create such tables
  
  <https://github.com/civicrm/civicrm-core/pull/8804/files>
  
  
  ---
  
  