What are some best practices for aligning columns in a dropdown list in PHP?

When displaying a dropdown list in PHP, it is important to align the columns for better readability and aesthetics. One way to achieve this is by using HTML table structure within the dropdown options. By setting fixed widths for each column and using padding or text alignment, you can align the columns effectively.

<select>
  <option value="">Select option</option>
  <?php
    $data = array(
      array('1', 'Option 1', 'Description 1'),
      array('2', 'Option 2', 'Description 2'),
      array('3', 'Option 3', 'Description 3')
    );

    foreach ($data as $row) {
      echo '<option value="' . $row[0] . '">';
      echo '<table><tr><td style="width: 50px;">' . $row[0] . '</td><td style="width: 100px;">' . $row[1] . '</td><td>' . $row[2] . '</td></tr></table>';
      echo '</option>';
    }
  ?>
</select>