A <tr> is absent, but there is a mistake of w3c
before
$html_msg['ORDER_TOTALS'] = '<table border="0" width="100%" cellspacing="0" cellpadding="2">' . $html_ot . ' </table>';
after
$html_msg['ORDER_TOTALS'] = '<table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr>' . $html_ot . ' </table>';
Bookmarks