I suspect posting it replaced the < and > with the HTML replacements. I also added a <TR> tag for the header which I believe is required for proper HTML form. I also noticed it's not fond of timestamp columns, but then again who is 🙂
set @ColumnHeader
= '<table cellpadding="2" cellspacing="2" border="1" style="font-family: Arial; font-size: 8pt"><TR>'
+ @ColumnHeader + '</TR>';