function cart_table($cols = 'full', $destination = '#', $showfooter = true)
{
    $cart_table = '
  <table class="table giftsum-table">
    <thead>
      <tr>
        <th class="th-title-gift">Gift</th>
        <th class="th-title-frequency">Frequency</th>
        <th class="th-title-amount">Amount</th>';
    if ($cols == 'full') {
        $cart_table .= '<th class="th-title-actions"></th>';
    }
    $cart_table .= '
      </tr>
    </thead>
    <tbody>
  ';
    $cart_table .= cart_row('http://placehold.it/90x70', 'Jean Deaux', '34343434', 'Monthly', 'Starts on: 7/8/2019', '$50.00', $cols);
    $cart_table .= cart_row('http://placehold.it/90x70', 'Jean Deaux', '34343434', 'Monthly', 'Starts on: 7/8/2019', '$50.00', $cols);
    $cart_table .= '</tbody>';
    if ($cols == 'full') {
        $cart_table .= '
        <tfoot class="mobile-footer-persist">
          <tr>
            <td colspan="4" class="text-right">
              <div class="checkout-cta pull-right">
                <a href="/sign-in/" class="btn btn-primary btn-lg btn-block">Proceed to Checkout</a>
              </div>
              <span class="giftsum-line">Your Monthly Gift Total: <strong>$50.00</strong></span>
              <span class="giftsum-line">Your Single Gift Total: <strong>$100.00</strong></span>
            </td>
          </tr>
        </tfoot>';
    } elseif ($cols == 3) {
        if ($showfooter) {
            $cart_table .= '
            <tfoot class="mobile-footer-persist">
              <tr>
                <td colspan="3" class="text-right">
                  <div class="checkout-cta pull-right">
                    <a href="/thank-you/" class="btn btn-primary btn-lg btn-block">Submit Your Gift</a>
                  </div>
                  <span class="giftsum-line">Your Monthly Gift Total: <strong>$50.00</strong></span>
                  <span class="giftsum-line">Your Single Total: <strong>$100.00</strong></span>
                </td>
              </tr>
            </tfoot>';
        }
    } elseif ($cols == 2) {
        if ($showfooter) {
            $cart_table .= '
            <tfoot>
              <tr>
                <td colspan="2" class="text-right">
                  <span class="giftsum-line">Monthly Gift Total: <strong>$50.00</strong></span>
                  <span class="giftsum-line">Single Total: <strong>$100.00</strong></span>
                </td>
              </tr>
              <tr>
                <td colspan="2">
                  <a href="/cart/" class="btn  btn-subtle  u-floatRight  mt">Edit Cart</a>
                </td>
              </tr>
            </tfoot>';
        }
    }
    $cart_table .= '</table>';
    return $cart_table;
}
<table class="table giftsum-table">
  <thead>
    <tr>
      <th class="th-title-gift">Gift</th>
      <th class="th-title-frequency">Frequency</th>
      <th class="th-title-amount">Amount</th>
      <th class="th-title-actions"></th>
    </tr>
  </thead>
  <tbody>
    <?php 
echo cart_row('http://placehold.it/90x70', 'Jean Deaux', '34343434', 'Monthly', 'Starts on: 7/8/2019', '$50.00');
?>
    <?php 
echo cart_row('http://placehold.it/90x70', 'Jean Deaux', '34343434', 'Monthly', 'Starts on: 7/8/2019', '$50.00');
?>
  </tbody>
  <tfoot class="mobile-footer-persist">
    <tr>
      <td colspan="3" class="text-right">
        <span class="giftsum-line">Your Monthly Gift Total: <strong>$50.00</strong></span>
        <span class="giftsum-line">Your Single Gift Total: <strong>$100.00</strong></span>
      </td>
      <td class="checkout-cta">
        <button type="submit" class="btn btn-primary btn-lg btn-block">
          Proceed to Checkout
        </button>
      </td>
    </tr>
  </tfoot>
</table>