the table rendering (especially header rendering) would look very complex as a template. i think it's cleaner to do it in js and delegate each cell out to a function that renders that cell