What are some best practices for creating variable-width and variable-height tables in PHP?

When creating variable-width and variable-height tables in PHP, it is important to use CSS to style the tables and make them responsive. One way to achieve this is by setting the table's width to a percentage value and using CSS properties like max-width and min-width to control its size. Additionally, setting the table's height to auto will allow it to adjust based on the content inside.

<table style="width: 100%; max-width: 800px; min-width: 300px; height: auto;">
  <tr>
    <th>Header 1</th>
    <th>Header 2</th>
  </tr>
  <tr>
    <td>Data 1</td>
    <td>Data 2</td>
  </tr>
</table>