Wednesday, October 29, 2014
Simple fix for pagination with Twitter Bootstrap
Advertise
As a Rails guy, I always perform my table pagination using mislav’s will_paginate gem. However, when I use it combined with Twitter Bootstrap, I get an undesired result:
There is a very simple fix for this which doesn’t require using an additional gem.
Add the following CSS to your application:
assets/stylesheets/pagination_fix.css 123456789101112131415161718192021 //------------------------------------------------------------------------------- // Pagination fix for will_paginate and bootstrap //------------------------------------------------------------------------------- .pagination { span.disabled { color: #aaa !important; } em.current { float: left; padding: 0 14px; line-height: 38px; text-decoration: none; background-color: white; border: 1px solid #DDD; border-left-width: 0; } .previous_page { border-left: 1px solid #ddd; } }Refresh your page and the pagination issues should be resolved:
Hope this helps!
I recently attempted to use the will_paginate gem with the latest version of Bootstrap (v2.2.1) and the pagination no longer rendered using the
This tip was provided by Søren Houen and found on the Railscasts comments.
Subscribe to:
Post Comments (Atom)
No comments: