Generate text table or HTML table given data