format header and footer