title: HTML table - convert each column into accordion on mobile
body: <p>I have a table which has the first column as the months of the year.</p>
  
  <p>There are four other columns - when the device breaks 768px and below, I want to turn each of the four columns into an accordion with the column heading as the accordion name. Each accordion contains a two column table, the months of the year and the values</p>
  
  <p><a href="https://i.stack.imgur.com/41rVW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/41rVW.png" alt="Browser table"></a></p>
  
  <p>So when the mobile device view is triggered, the user sees an accordion with the heading "Monthy earnings" and within that accordion</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;table&gt;
    &lt;tr&gt;
      &lt;td&gt;January&lt;/td&gt;
      &lt;td&gt;200&lt;/td&gt;
      &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;February&lt;/td&gt;
      &lt;td&gt;250&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
      &lt;td&gt;March&lt;/td&gt;
      &lt;td&gt;200&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
      &lt;td&gt;April&lt;/td&gt;
      &lt;td&gt;240&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;</code></pre>
  </div>
  </div>
  </p>