How can the use of if-else statements in PHP impact the vertical alignment of data in an HTML table?

When using if-else statements in PHP to conditionally generate data for an HTML table, it can impact the vertical alignment of the table cells. This is because the height of the cells might vary depending on the content generated by the if-else conditions. To ensure consistent vertical alignment, you can use CSS to set the vertical-align property of the table cells to 'middle'.

<?php
// Sample PHP code generating HTML table with if-else statements
echo '<table>';
for ($i = 1; $i <= 5; $i++) {
    echo '<tr>';
    if ($i % 2 == 0) {
        echo '<td style="vertical-align: middle;">Even</td>';
    } else {
        echo '<td style="vertical-align: middle;">Odd</td>';
    }
    echo '</tr>';
}
echo '</table>';
?>