Force Bootgrid pagination element to stay in one position relative to it's parent container regardless of the number of table rows?

徘徊边缘 提交于 2019-12-23 17:21:06

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!