replace tables with div and dl in templates