2

I need to insert a very large html table in the body of an outlook mail, the problem is that I don't now how to avoid that the columns shrink, practically displaying the text vertically (the text breaks when the number of columns and the characters inside becomes too high, there seems to be a width limit for html tables).
Can anyone help me find a solution to make the whole row visible without wrapping or column shrinking?

For example if you try to insert this html table in the body of a mail you immediatly see that the column is shrinked.

<table border="1">
<tr>
    <td>Test_width_column</td>  <td>Test_width_column</td> 
    <td>Test_width_column</td>  <td>Test_width_column</td> 
    <td>Test_width_column</td>  <td>Test_width_column</td> 
    <td>Test_width_column</td>  <td>Test_width_column</td> 
    <td>Test_width_column</td>  <td>Test_width_column</td> 
    <td>Test_width_column</td>  <td>Test_width_column</td> 
    <td>Test_width_column</td>  <td>Test_width_column</td> 
    <td>Test_width_column</td>  <td>Test_width_column</td> 
    <td>Test_width_column</td>  <td>Test_width_column</td> 
    <td>Test_width_column</td>  <td>Test_width_column</td> 
    <td>Test_width_column</td>  <td>Test_width_column</td> 
    <td>Test_width_column</td>  <td>Test_width_column</td> 
    <td>Test_width_column</td>  <td>Test_width_column</td> 
    <td>Test_width_column</td>  <td>Test_width_column</td> 
    <td>Test_width_column</td>  <td>Test_width_column</td> 
    <td>Test_width_column</td>  <td>Test_width_column</td> 
    <td>Test_width_column</td>  <td>Test_width_column</td> 
    <td>Test_width_column</td>  <td>Test_width_column</td> 
    <td>Test_width_column</td>  <td>Test_width_column</td> 
    <td>Test_width_column</td>  <td>Test_width_column</td> 
    <td>Test_width_column</td>  <td>Test_width_column</td> 
    <td>Test_width_column</td>  <td>Test_width_column</td> 
    <td>Test_width_column</td>  <td>Test_width_column</td> 
    <td>Test_width_column</td>  <td>Test_width_column</td> 
    <td>Test_width_column</td>  <td>Test_width_column</td> 
    <td>Test_width_column</td>  <td>Test_width_column</td> 
    <td>Test_width_column</td>  <td>Test_width_column</td> 
    <td>Test_width_column</td>  <td>Test_width_column</td> 
    <td>Test_width_column</td>  <td>Test_width_column</td> 
    <td>Test_width_column</td>  <td>Test_width_column</td> 
    <td>Test_width_column</td>  <td>Test_width_column</td> 
    <td>Test_width_column</td>  <td>Test_width_column</td> 
    <td>Test_width_column</td>  <td>Test_width_column</td> 
    <td>Test_width_column</td>  <td>Test_width_column</td> 
</tr>

If someone manages to set properties or css so as not to tighten the columns of this example, let me know! Thanks for help!

matthias_h
  • 11,356
  • 9
  • 22
  • 40
Robb
  • 21
  • 2
  • Does this answer your question? [CSS text-overflow in a table cell?](https://stackoverflow.com/questions/9789723/css-text-overflow-in-a-table-cell) – Mox Mar 18 '20 at 14:23
  • I've already tried add this CSS, that works for normal HTML page, but not in outlook mail: – Robb Mar 18 '20 at 16:41

2 Answers2

0

try to add CSS like this

  .td{width: 20px;}
Akshay jadhav
  • 58
  • 1
  • 11
  • No, for example min-width works in normal HTML page, but not in outlook body mail, i nedd other solution... – Robb Mar 18 '20 at 15:00
0

The problem is that the rendering engine isn't a browser control, it's actually MSWord. The only way I've found around it is to use conditional html that is only used by Outlook. I wrap my tables in an Outlook only table that has a fixed width. The tables can't resize in Outlook, but they still do in every other email client.

   <!--[if mso]>
    <table width="600">
      <tr>
        <td>
    <![endif]-->
<table> <!-- this is the regular table -->
</table>
    <!--[if mso]>
        </td>
      </tr>
    </table>
  <![endif]-->

Rendering engines that don't use MSWord will ignore the new table as just html comments, but Outlook will see those as instructions to render the the code between the if/endif tags.