Fix index view template

The tables in generated index views currently do not have `thead` or `tbody` tags. This PR adds them for proper syntax and to be consistent with the erb generator.