I have a table with four columns and two rows:
<table>
<tr>
<td> A </td>
<td> B </td>
<td> C </td>
<td> D </td>
</tr>
<tr>
<td> E </td>
<td> F </td>
<td> G </td>
<td> H </td>
</tr>
</table>
Using a query media, for example @media (max-width: 800px), I want to restructure this table to instead have two columns and four rows, for example:
<table>
<tr>
<td> A </td>
<td> B </td>
</tr>
<tr>
<td> C </td>
<td> D </td>
</tr>
<tr>
<td> E </td>
<td> F </td>
</tr>
<tr>
<td> G </td>
<td> H </td>
</tr>
</table>
Is it possible? JavaScript solutions are also welcome if, I believe, this cannot be done with simple CSS.
source
share