问题
I am having trouble getting the pagination element of a JQuery Bootgrid table I am working on to stay in the correct position. It seems to be positioned relative to the last table row no matter what I try. I have tried setting the container div to relative and using top, left, etc. but I couldn't get it to work. Here are some pics to show the current positioning of the pagination:
I am trying to get the pagination positioned similarly to the button labeled "Click Me!". This is where I want the element to be permanently, no matter how many items are in the table:
The pagination element can be targeted using this:
" #form .bootgrid-footer .pagination, .bootgrid-header .pagination "
I have set up a demo in JSFiddle. The last entry in the CSS section is labeled as indicated above and will effect the styling of the Bootgrid pagination.
See JSFiddle
回答1:
http://jsfiddle.net/1k5btepn/3/
#grid-command-buttons-footer .col-sm-6 {
position: absolute;
top: 450px;
}
The issue is that if you set the .pagination elements CSS, even if it is absolute, it is still relative to the .col-sm-6 element (because .col- classes are position: relative). But, if you target the correct .col-sm-6 element, you can position it the way you want.
来源:https://stackoverflow.com/questions/38981771/force-bootgrid-pagination-element-to-stay-in-one-position-relative-to-its-paren