title: Dynamic table with border
body: <p>I created an email alert that gets sent out once a day with a list of accounts that are getting deliveries the next day. This is working fine but since i'm using a dynamic table, some users are complaining that its hard to read without any borders.</p>
  
  <p>See example:
  <a href="https://ibb.co/dGTvPsG" rel="nofollow noreferrer">https://ibb.co/dGTvPsG</a></p>
  
  <p>And here's how i'm doing it:</p>
  
  <pre><code>while($res = mysqli_fetch_array($result)) {  
  
  
  $a[] = $res['Order_Number'];
  $b[] = $res['Detail_ShipDate'];
  $c[] = $res['ShipTo_Name'];
  $d[] = $res['Status'];
  
  $Order_Number = implode("&lt;br /&gt;", $a);
  $Detail_ShipDate = implode("&lt;br /&gt;", $b);
  $ShipTo_Name = implode("&lt;br /&gt;", $c);
  $Status = implode("&lt;br /&gt;", $d);
  
  
  $for_php_mailer = '&lt;table style="border: 1px solid black;
  width: 100%;font-size: 12px!important;"&gt;
  
  &lt;tr&gt;
  &lt;th&gt;Delivery Date&lt;/th&gt;
  &lt;th&gt;Order#&lt;/th&gt;
  &lt;th&gt;Company Name&lt;/th&gt;
  &lt;th&gt;Status&lt;/th&gt;
  
  &lt;td&gt;'.$Detail_ShipDate.'&lt;/td&gt;
  &lt;td&gt;'.$Order_Number.'&lt;/td&gt;
  &lt;td&gt;'.$ShipTo_Name.'&lt;/td&gt;
  &lt;td&gt;'.$Status.'&lt;/td&gt;
  
  &lt;/tr&gt;
  
  &lt;/table&gt;';
  </code></pre>
  
  <p>Instead of that, I need it to look like this: <a href="https://ibb.co/XsVgZWv" rel="nofollow noreferrer">https://ibb.co/XsVgZWv</a></p>
  
  <p>I tried different combinations of the following but one or two things happen. I only get 1 record from the table or an Illegal string offset error.</p>
  
  <p>I'm still learning and would greatly appreciate help.</p>
  
  <pre><code>while($res = mysqli_fetch_array($result)) {  
  foreach ( $res as $data ) 
  {
  $for_php_mailer ='
      &lt;td&gt;'.$data['Detail_ShipDate'].'&lt;/td&gt;
      &lt;td&gt;'.$data['Order_Number'].'&lt;/td&gt;
      &lt;td&gt;'.$data['ShipTo_Name'].'&lt;/td&gt;
      &lt;td&gt;'.$data['Status'].'&lt;/td&gt;';
  }
  </code></pre>