Build HTML string for tables before appeappending