Fix index view template

The tables in generated index views currently do not have `thead` or `tbody` tags. This PR adds them.