title: Looping array data within blade
body: <p>I make some API calls and fill up an array.  I have identified three different ways an array element might come</p>
  
  <pre><code>array:9 [▼
    0 =&gt; array:2 [▼
      "jobData" =&gt; array:5 [▶]
      "clientData" =&gt; array:3 [▶]
    ]
    5 =&gt; array:3 [▼
      "jobData" =&gt; array:5 [▶]
      "clientData" =&gt; array:3 [▶]
      "customData" =&gt; array:1 [▼
        "Type of work" =&gt; array:1 [▼
          "Type of work" =&gt; "Something"
        ]
      ]
    ]
    8 =&gt; array:3 [▼
      "jobData" =&gt; array:5 [▶]
      "clientData" =&gt; array:3 [▶]
      "customData" =&gt; array:2 [▼
        "Month" =&gt; array:1 [▼
          "Month" =&gt; "Aug 16"
        ]
        "Type of work" =&gt; array:1 [▼
          "Type of work" =&gt; "Something"
        ]
      ]
    ]
  ]
  </code></pre>
  
  <p>So Element 0 only has jobData and clientData.  Element 5 has these two plus a cusomtData for Type of Work.  Element 8 has everything including customData
  for Type of Work and Month.  Custom Data will either be completely empty, contain one, or contain both.</p>
  
  <p>I am trying to display this data in a table.  Most of it is simple enough apart from the custom data.  At the moment I have something like this</p>
  
  <pre><code>&lt;table class="table table-bordered table-hover additionalMargin alignment reportTable"&gt;
      &lt;tr class="col-md-12 noPadding"&gt;
          &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Job ID&lt;/th&gt;
              &lt;th&gt;Job Name&lt;/th&gt;
              &lt;th&gt;Category&lt;/th&gt;
              &lt;th&gt;Client Name&lt;/th&gt;
              &lt;th&gt;Type of work&lt;/th&gt;
              &lt;th&gt;Month&lt;/th&gt;
          &lt;/tr&gt;
          &lt;/thead&gt;
      &lt;/tr&gt;
      &lt;tbody&gt;
          @if(is_array($jobArray))
              @foreach($jobArray as $array)
                  &lt;tr&gt;
                      &lt;td&gt;{{ $array['jobData']['JobID'] or '' }}&lt;/td&gt;
                      &lt;td&gt;{{ $array['jobData']['JobName'] or '' }}&lt;/td&gt;
                      &lt;td&gt;{{ $array['jobData']['Category'] or '' }}&lt;/td&gt;
                      &lt;td&gt;{{ $array['clientData']['ClientName'] or '' }}&lt;/td&gt;
                      &lt;td&gt;{{ $array['customData']['Type of work'] or '' }}&lt;/td&gt;
                      &lt;td&gt;{{ $array['customData']['Month'] or '' }}&lt;/td&gt;
                  &lt;/tr&gt;
              @endforeach
          @endif
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Now because the elements in my custom data are also arrays, this means I need to do another loop for them.  So I could potentially do this</p>
  
  <pre><code>@if(!empty($array['customData']))
      @foreach($array['customData'] as $data)
          &lt;td&gt;{{ $data['Type of work'] or '' }}&lt;/td&gt;
          &lt;td&gt;{{ $data['Month'] or '' }}&lt;/td&gt;
      @endforeach
  @endif
  </code></pre>
  
  <p>The problem with the above is that it seems to create its own tds and things are not matched up properly.  I am essentially seeing something like this
  <a href="https://i.stack.imgur.com/fQ741.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fQ741.png" alt="enter image description here"></a>
  How can I make things align up appropiately?</p>
  
  <p>Thanks</p>