Updated controller template to replace table layout with divs and spans