将两个条件结果放在表中

I am trying to put two conditional if result statements in a table but not able to get results.

So if form input is empty then result is not displayed.

To save space I would like to place results in table with two or three columns.

       if( ! empty( $lect ) )
           $result .= '<p>'. __('<table class="custom-data"><span id="si" >Name:</span> ').'<span id="si1" >'.$lect.'</span></table></p>';
    if( ! empty( $lect1 ) )
           $result .= '<p>'. __('<table class="custom-data"><span id="si">Product :</span> ').'<br><span id="si1" >'.$lect1.'</span></table></p>';

Present Output: Present Output
Expected output:
Desired Output in two columns

Please see below to separate into separate columns:

$result .= '<table class="custom-data"><tr>';
if( ! empty( $lect ) )
   $result .= '<td><p>'. __('<span id="si" >Name:</span> ').'<span id="si1" >'.$lect.'</span></p></td>';
if( ! empty( $lect1 ) )
   $result .= '<td><p>'. __('<span id="si">Product :</span> ').'<br><span id="si1" >'.$lect1.'</span></p></td>';
$result .= '</tr></table>';

Then I guess you are returning $result. This put's the result in one row and conditional columns.