Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML Emails Format is not working in Outlook

My HTML email format is not functioning properly in outlook. The code is using angular and bootstrap css. I have used inline css specially for outlook but when i see the email in outlook table is stretched in full screen.

I have seen some question and used the implementation suggested in answers but still showing this problem. my code is as follow:

     <table class="table table-striped table-bordered table-condensed" width="320" style="margin-bottom: 20px;border: 1px solid #ddd; border-collapse: collapse">
        <tr ng-repeat="x in xall | orderBy:'name':false" style="padding: 5px; border: 1px solid #ddd; border-bottom-width: 2px;">
          <th style="text-align: left; padding: 5px; border: 1px solid #ddd; border-bottom-width: 2px; width:40%;">Site Revenue</th>
          <td style="padding: 5px; border: 1px solid #ddd; border-bottom-width: 2px; width:30%;" class="number" ng-if="!data.isPrev">£850</td>
          <td style="padding: 5px; border: 1px solid #ddd; border-bottom-width: 2px; width:30%;" class="number" ng-if="data.isPrev">£500</td>
        </tr>
        <tr ng-repeat="x in xall | orderBy:'name':false" style="padding: 5px; border: 1px solid #ddd; border-bottom-width: 2px;">
          <th style="text-align: left; padding: 5px; border: 1px solid #ddd; border-bottom-width: 2px; width:40%;">Product Revenue</th>
          <td style="padding: 5px; border: 1px solid #ddd; border-bottom-width: 2px; width:30%;" class="number" ng-if="!data.isPrev">£650</td>
          <td style="padding: 5px; border: 1px solid #ddd; border-bottom-width: 2px; width:30%;" class="number" ng-if="data.isPrev">£570</td>
        </tr>
      </table>

Please put some suggestions as I am totally stuck with this issue as width attribute is not functioning with outlook.

like image 260
Jitendra Pareek Avatar asked May 31 '26 11:05

Jitendra Pareek


1 Answers

I had the same problems. Here are some hints:

  1. when you give padding attribute, it should go like this: padding:5px 5px 5px 5px;

  2. floating (float) CSS attribute is not working in outlook.

  3. when you give background color which need to be given as ( bgcolor ) in table attribute.

  4. Write all CSS attributes inline

like image 195
Prasanga Avatar answered Jun 03 '26 02:06

Prasanga



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!