improve layout for elems and pagination