I have some pagination code defined in a variable ($pager) that I would like to appear at the top and bottom of a table ($table).
I’ve tried the following:
$pager.
insertBefore($table);
insertAfter($table);
However, the second instruction appears to overwrite the first, meaning the pages only appear beneath the table. How can I insert the pagination at the top and bottom of the table?
You should
cloneyour pager object, but be careful with your markup, since you could end up having duplicated id attributes:And if you want to clone also and all their event handlers, use clone(true).