Filter widget positioning on mobile view
-
Hello Tobias,
I’m struggling with CSS-positioning the filter widgets on mobile/tablet view. On desktop view everything works fine with this code:
/*Filtering section on desktop screen*/
/*Column filter widget settings*/
.column-filter-widgets {
float: right;
width: 30%;
}/*Search box filter*/
.dataTables_filter {
float: left;
width: 40%;
padding-bottom: 10px;
}/*Length filter – Show X number of rows*/
.dataTables_length {
float: left;
width: 27%;
padding-bottom: 10px;
}/*Widget-4 filter features*/
.column-filter-widget .widget-4 {
width: 160px;
text-align: center;
padding-bottom: 10px;
}/*Widget-6 filter features*/
.column-filter-widget .widget-6 {
width: 160px;
text-align: center;
padding-bottom: 10px;
}This works nice on desktop view, because every filter button is in the same row.
On mobile view, I just want to set the main search filter to the right side of the screen and under the search box the widget-4 and widget 6 column filter, also adjusted to the right side of the screen. How can I achieve that?
I also tried to change the size of this buttons on mobile screen, I can affect the size of column filters, but the search filter not. Why?Thank you in advance!
-
This topic was modified 7 years, 1 month ago by
andrea1989.
-
This topic was modified 7 years, 1 month ago by
-
Hi,
thanks for your post, and sorry for the trouble.
This is rather tricky, I’m afraid, due to the HTML structure 🙁
Can you please post a link to the page with the table where this problem happens, so that I can take a direct look? Thanks!
Regards,
Tobiashttp://doggobase.com/doggobase/
I don’t need the length filter on mobile view, just the search box and the two widget box. If not possible to visualize it like I want, please help me how to put them above the table to look acceptable.
I highly appreciate your time and effort you put into helping me to solve this problem.
Thank you!Hi,
thanks! The closest that I can get it is to use
/*Column filter widget settings – breed, followers*/ .column-filter-widgets { float: none; width: 100%; text-align: center; } /*Search box filter*/ .dataTables_filter { float: right; width: 100%; text-align: center; } /*Breed filter features*/ .column-filter-widget { float: right; }in the
@media screen and (max-width:604px) {section.
Regards,
TobiasThank you Tobias, it’s working! 🙂
P.S.: I experienced slipping in button positioning on different screen sizes, like tablets – the buttons are slipped according to the screen sizes:
Mobile screen – acceptable:
http://whatismyscreenresolution.net/multi-screen-test?site-url=http://doggobase.com/doggobase/&w=414&h=736
Tablet – slipped buttons:
http://whatismyscreenresolution.net/multi-screen-test?site-url=http://doggobase.com/doggobase/&w=800&h=1280
Netbook – slipped buttons:
http://whatismyscreenresolution.net/multi-screen-test?site-url=http://doggobase.com/doggobase/&w=1024&h=600
Desktop – nice spacing:
http://whatismyscreenresolution.net/multi-screen-test?site-url=http://doggobase.com/doggobase/&w=1280&h=950I accept if we can’t control it, just want to show it.
Thank you so much for your help!!
Hi,
this might be caused by the different CSS media queries that you are using, but I’m not sure, sorry.
Regards,
TobiasDoesn’t matter, I will figure out how to fix this, thank you for your help!
Hi,
sure, no problem! Always happy to help!
Best wishes,
Tobias
The topic ‘Filter widget positioning on mobile view’ is closed to new replies.