I figured out what was wrong, in case someone else is having a similar problem it seems that you can only display html directly after the publish %% markup if you want it to be properly published...
So this works:
htmlTable = GTHTMLtable(...);
disp(['' htmlTable ']);
but this doesn't:
htmlTable = GTHTMLtable(...);
disp(['' htmlTable ']);