title: How to display two different arrays in a single table in parallel like Left and Right in Php
body: <p>I've 2 array $expense and $income.</p>
  <p><strong>Income array</strong></p>
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [head] =&gt; chitty_installment
              [amount] =&gt; 500.00
          )
  
      [1] =&gt; Array
          (
              [head] =&gt; sales
              [amount] =&gt; 100000.00
          )
  
  )
  </code></pre>
  <p><strong>Expense Array</strong></p>
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [head] =&gt; purchase
              [amount] =&gt; 2000.00
          )
  
      [1] =&gt; Array
          (
              [head] =&gt; sales-return
              [amount] =&gt; 9000.00
          )
      [2] =&gt; Array
          (
              [head] =&gt; salary 
              [amount] =&gt; 11000.00
          )
  
  )
  </code></pre>
  <p>I'm trying to print these details like Expense in Left side And Income In Right side of a table
  That is The table looks like,</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: center;">Expense</th>
  <th style="text-align: center;">Amount</th>
  <th style="text-align: center;">Income</th>
  <th style="text-align: center;">Amount</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: center;">purchase</td>
  <td style="text-align: center;">2000.00</td>
  <td style="text-align: center;">chitty_installment</td>
  <td style="text-align: center;">500.00</td>
  </tr>
  <tr>
  <td style="text-align: center;">sales-return</td>
  <td style="text-align: center;">9000.00</td>
  <td style="text-align: center;">sales</td>
  <td style="text-align: center;">100000.00</td>
  </tr>
  <tr>
  <td style="text-align: center;">salary</td>
  <td style="text-align: center;">11000.00</td>
  <td style="text-align: center;"></td>
  <td style="text-align: center;"></td>
  </tr>
  </tbody>
  </table>
  </div>
  <pre><code>
      &lt;table class=&quot;table table-striped&quot;&gt;
          &lt;thead&gt;
              &lt;tr&gt;
                  &lt;th&gt;&lt;b&gt;EXPENDITURE&lt;/b&gt;&lt;/th&gt;
                  &lt;th&gt;&lt;b&gt;AMOUNT&lt;/b&gt;&lt;/th&gt;
                  &lt;th&gt;&lt;b&gt;INCOME&lt;/b&gt;&lt;/th&gt;
                  &lt;th&gt;&lt;b&gt;AMOUNT&lt;/b&gt;&lt;/th&gt;
              &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody&gt;
              &lt;?php foreach ($expense as $exp) { ?&gt;
              &lt;tr&gt;
                  &lt;td&gt;&lt;?php echo $exp['head']; ?&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;?php echo $exp['amount']; ?&gt;&lt;/td&gt;
              &lt;?php foreach ($income as $inc) { ?&gt;
      
                  &lt;td&gt;&lt;?php echo $inc['head']; ?&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;?php echo $inc['amount'] ?&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;?php }
                  } ?&gt;
          &lt;/tbody&gt;
      &lt;/table&gt;
  
  </code></pre>