Here is a tweak to improve display consistency.
The code above will start a new line for the heading, but if the last row was filled, there will already be a new line. If there is a new line, $col will be 0, so replace thiswith thisPHP Code:$col = 0;
$row ++;
PHP Code:$col != 0?$row ++:'';
$col = 0;





