Tagged: mobile optimization, table
-
AuthorPosts
-
March 25, 2024 at 4:10 pm #1438280
Hello,
I’m working on this page https://www.romacittaperta.com/premi/ I added some custom CSS to get large spaces inside the lines, but in the last one I was forced to add a “dot” to have the same height of the other lines. Can you fix this bug?
Furthermore, viewing the table on mobile is really inconvenient for users. Would it be possible to compact it as if it were viewable as if the user activated the Chrome desktop view flag? Basically I would like to get a result similar to the following screenshot https://app.box.com/s/r33fkdwdvfag0x9nyc6obl8ixy0p1rtw
In reality the need to compact the mobile view is present in many other pages, homepage for example, is there a way to find an approach that can be used extensively on all pages? If necessary, I am available to create 2 versions of the same page, one that can be activated from desktop/tablet and one for smartphones. The standard approach would be to activate 2 versions of each color section present on the page, but this is not good because it would penalize page loading times
Thanks in advance for your assistance
AndreaMarch 27, 2024 at 10:03 pm #1438493Hey cuccarini,
Thank you for your patience and the link to your site, for your table your custom css was setting the table to flex but not the last row, I adjusted your css so the last row is also flex and removed the dots, now it works correctly.
Compared to your screenshot it looks like you would like the table to have the two columns side-by-side, so to do this I added this css:@media only screen and (max-width: 767px){ .responsive .mobile-two-columns .pricing-table-wrap { display: table-cell; width: 30%; } }
and then I added the custom class mobile-two-columns to your first table:
and now the columns are side-by-side on mobile under the image:
I know your screenshot showed the image and the two columns all in one row, but this made the table too small on smaller devices like iPhone 7.
If you want to add this to your other tables, then add the custom class mobile-two-columns to them like the first one.Best regards,
MikeMarch 28, 2024 at 1:49 am #1438508Hello Mike,
nice to meet you again, thanks for editing my pricing table CSS, honestly I prefer to have only one column and not two, but I understand your point of view.
Unfortunately, as I wrote previously, I have to compact the mobile view in many complex pages, for example:
– https://www.romacittaperta.com/
– https://www.romacittaperta.com/iscrizione-master/
– https://www.romacittaperta.com/risultati-master/
– https://www.romacittaperta.com/calendario/
and so on.I understand it’s a lot of effort, but having 70% of user access via mobile is necessary for the user experience.
What approach do you suggest? Do I need to change the screen length of the entire website? Is there a way to find an approach that can be used widely across all pages? Maybe I need to change the mobile class of an entire page, or change the mobile class of many color sections, or change the mobile class of many individual components?If necessary, I am available to create 2 versions of the same page, one that can be activated from desktop and tablet and one only for smartphones.
I know the standard approach would be to activate 2 versions of each inside color section on the page, but this is not good because it would penalize page load times because all color sections will be loaded even if not displayed.I want to obtain the best possible result in terms of smartphone usability, to obtain this result all my efforts are justified, even redesigning the entire site.
Thanks again for your support
AndreaMarch 28, 2024 at 3:58 am #1438512Hi,
I guess that I misunderstood, your screenshot showed two columns of the table side-by-side, the default behavior is a single full width column like what is shown on your site now:
since you say that you prefer a single column, I recommend not using the solution above and just leave it as it is right now.Best regards,
MikeMarch 28, 2024 at 11:03 am #1438540Sorry Mike,
I apologize, in my response I think I sent you in the wrong direction.
I want to get a result similar to the following screenshots.
https://app.box.com/s/wy8isg2s7c6gs58yh3a2i8aluoqu5v3c
My goal is to condense all the columns in one row, as if the desktop view was activated on the smartphone browser.
Last example in the following screenshot I want to see on mobile the whole table, not only 2 – 3 columns
https://app.box.com/s/0fz4zksplt2efl66cj2tzsn29tfayu9uThanks again for your support
AndreaMarch 28, 2024 at 11:16 am #1438541PS the condensed layout to be obtained is not limited to the tables alone, but to all the pages of the website.
March 28, 2024 at 4:53 pm #1438556Hi,
Thanks for the feedback I think I understand better now, basically you want to disable all of the mobile styles, which may make your site hard to read on mobile devices because all of the elements will be very small. Typically this would be a very big job to overwrite all of the mobile css, but I found a solution that wotks on my demo site, notice in this screenshot that the elements display like on a desktop just smaller:
Try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor, or if you are not using a child theme you could use the WP Code plugin then add a new snippet, in the top right corner use the PHP snippet as the code type:
then add this code and save.function my_custom_viewport_meta( $meta_viewport ) { return '<meta name="viewport" content="width=1024">'; } add_filter( 'avf_header_meta_viewport', 'my_custom_viewport_meta' );
After applying please clear your browser cache and check.
Best regards,
MikeMarch 28, 2024 at 8:12 pm #1438564Hello Mike,
I always use the enfold child theme ;-)
I inserted the code as requested in function.php. I must say that the result is very good, you can check this viewing the website by mobile.
Clearly there are some bad situations in particular on some color sections of pages, for examplte:
– first color section after layerslider in the homepage
– Icon flipbox grid in the homepage
– the writings in the layerslider are difficult to read
Is the best solution to create an ad hoc color section for the mobile view?Thanks again for your support
AndreaMarch 29, 2024 at 11:06 am #1438675Hello Mike,
Hope you doing well.
I prepared some example of visualizations to rectify. https://app.box.com/s/s8z4x22a3lgroit7z94fk6dczn2sru9f
I believe that if it were possible to add specific CSS classes in the color section in the different situations to be rectified, this would be an excellent solution. Something similar to what you did before using .mobile-two-columns.Thanks again for your support
AndreaMarch 29, 2024 at 11:36 am #1438677Hi,
Unfortunately the function above doesn’t allow the media queries to work so I can’t add css to make this change only for mobile, I recommend changing your page layout to suit.
You could try creating a second set of elements and use the element visibility options to hide the desktop version and show your new mobile version, but I don’t think this will work because the element visibility options use the same css media queries to work.
So your best option may be to design your page layout with the mobile view in mind and show it the same way for desktop, since above you wrote that 70% of user access is via mobile.Best regards,
MikeMarch 29, 2024 at 11:53 am #1438679Thanks Mike….I understand.
In your opinion, wouldn’t it be possible to override your general mobile behavior and create some exceptions that override the actual visualization?
Or could I make two versions of the same page and activate one page for desktop view and the other for mobile view?
Finally, in the hypothesis of completely reviewing the layout from a mobile first perspective, would it be appropriate to narrow the width of the desktop screen, leaving two areas on the right and left empty? In this case, could they be filled with some canvas or texture to make them less anonymous?A thousand thanks
AndrewMarch 29, 2024 at 11:56 am #1438680Hello mike,
forget about my previous message, it is a wrong question unfortunately.In your opinion, instead of using a general mobile rule applied to the entire site as now, wouldn’t it be possible to use different classes for mobile viewing applied to each color section? In my design I build the page by inserting all the components in a sequence of color sections, I find it a very rational and convenient way. So in my case, by applying the class to each color section, I could obtain different specific behaviors for each type of graphic configuration of the color section.
Or could I make two versions of the same page and activate one page for desktop view and the other for mobile view?
Finally, in the hypothesis of completely reviewing the layout from a mobile first perspective, would it be appropriate to narrow the width of the desktop screen, leaving two areas on the right and left empty? In this case, could they be filled with some canvas or texture to make them less anonymous?
Thanks for helping
AndrewMarch 29, 2024 at 5:20 pm #1438703Hi,
The function above can’t be applied to certain sections, it is applied to the whole page for it to work, but I think that you can choose which pages to apply it to, so if you have a page that doesn’t need it it all we could disable it. As this function seems to help for most of your site, as I understand, it sounds like just a couple of areas that you want to adjust.
So for example on your /iscrizione-master/ page you wanted to change this:
So I found that if we use css media queries for 1024px it seems that they will work, that is when the page is really 425px the site and css thinks it is 1024px, but above 1024px the css seems to work correctly.
So try adding this custom class to this color section that you don’t want to show on mobile screens: hide-on-small and then create a new color section with the changes per your screenshot above to show on the mobile screens with the custom class: hide-on-large and then add this css:@media only screen and (max-width: 1025px) { #top .hide-on-small { display: none; } } @media only screen and (min-width: 1026px) { #top .hide-on-large { display: none; } }
I believe that this will work, and if it does then you can repeat this for your other color sections using the same classes accoss your site.
Best regards,
MikeMarch 29, 2024 at 8:08 pm #1438717Hello Mike,
I followed your suggestion, the result is this mobile optimizazione of the homepage. https://www.romacittaperta.com/
I think is an excellent result … thanks again for your great help.Before closing the ticket, do you think it is possible to use the “usual” mobile burger menu or am I obliged to use the standard one?
I’m writing this, because the standard isn’t clearly visible on mobile… but I can’t enlarge it to make it too big for the desktop visualization.
I swear I won’t bother you for at least another year! :-DKind regards
AndrewMarch 30, 2024 at 11:20 am #1438728Hi,
Well do, to have a burger menu up to 1024px try this CSS in your Enfold Theme Options ▸ General Styling ▸ Quick CSS field:@media only screen and (max-width: 1024px) { #top #header .av-main-nav > li.menu-item { display: none!important; } #top #header .av-burger-menu-main { cursor: pointer; display: block!important; } }
After applying the css, please clear your browser cache and check.
Best regards,
MikeMarch 30, 2024 at 1:39 pm #1438748Thanks Mike,
it worked perfectly, I really don’t know how to thank you, without your help I would never have achieved similar results.
Your technical skills on wordpress customization and enfold theme are really impressive. :-OOf course , you can close the ticket now.
With great gratitude
AndrewMarch 30, 2024 at 2:40 pm #1438751Hi,
Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.Best regards,
Mike -
AuthorPosts
- The topic ‘Bug in last row of table’ is closed to new replies.