added option for placing pagination to any dom element