• To: mr3316a;

    This is a very simple solution to just your problem exactly as you have defined it, so this would apply to only you case (everyone else ignore this).

    Modify the existing procedure something like below, presuming your input @SQL will only ever produce 5 columns, you could insert an additional header row containing inline styling and static text values, insert it directly below '<table id="t">' like so:

    ' <table id="t">

    <tr>

    <th style="background-color: red"></th>

    <th colspan="2" style="background-color: blue"><font color="#ffffff">Static Text Cols 2 and 3</font></th>

    <th colspan="2" style="background-color: black"><font color="#ffffff">Static Text Cols 4 and 5</font></th>

    </tr>

    <tr>

    ' + @colheads + '

    </tr>'

    Insert a non-breaking-space into the first column ... this message editor translates that out 😉