In the bigger picture of this code, this function simply builds the HTML and passes it back to the http client response handler to send it to the requesting client. So it needs to be in a variable to pass around, not serial printed.
sterretje:
Why build a full string? You can print the individual parts piece by piece; they end up in a buffer before being send.Serial.print("Hello ");
Serial.print("World!");
has the same effect asSerial.print("Hello World!");