add extra templates to head and end of each dopaging row