title: Create an html table dynamically with PHP loops
body: <p>This is a PHP array that has to be presented in a tabular format:</p>
  
  <pre><code>array:100 [▼
    "Brand #1" =&gt; array:3 [▼
    "2000" =&gt; "750.00"
    "2001" =&gt; "1750.00" 
    ..  
    ]
    "Brand #2" =&gt; array:3 [▼
      "2000" =&gt; "845.00"
      "2001" =&gt; "945.00"
      ..
    ]
    ..
    ..
  </code></pre>
  
  <p>The table should look like this:</p>
  
  <p><img src="https://i.stack.imgur.com/qYio6.png" alt="enter image description here"></p>
  
  <p>I've been trying hard to present the data from the array in the table format using a bunch of PHP loops, but after several hours I came to a conclusion that it is not possible to generate a table like the one shown above without splitting the array into two separate data sources.</p>
  
  <p>Am I right, or is there a way to achieve the desired output?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I think some users did not get the gist of the question hence these hastily downvotes. </p>
  
  <p>I admit, I was not detailed enough. </p>
  
  <p>Please notice that the dates  (from 2000 to 2004) will be repeated 100 times for every record in the top-level array. The table has only one set of dates (the first column).</p>
  
  <p>Therefore, I wanted to support or rebuke my conclusion that such a table cannot be generated out of the provided data source AS IS.</p>