-
AuthorPosts
-
July 12, 2022 at 10:12 am #1358045
Hello, everyone,
How do I get multiple columns in the table to have the same heading? You can find an example below https://www.palfingerepsilon.com/de_DE/Holzwirtschaft/Holztransport/M-Serie-EpsolutionRight now this is my version of the table:
https://afm.burde.media/transporttechnik/krantechnik/palfinger-epsilon/#m-serieThe behavior of the table, so that the part after the label column can be scrolled, should somehow be feasible.
Hopefully you can help me.
THX
July 13, 2022 at 4:25 am #1358142Hey burdeMedia,
Thank you for the inquiry.
Would you mind providing a screenshot of the section or table that requires adjustment including the actual changes? You can use imgur, savvyify or dropbox for the screenshot. Thanks!
If you need the table to be scrollable, please set the Styling > Table Styling > Table Purpose to the second option (tabular data), then go to the Advanced > Responsive and set the Responsive Styling to the second option (scrollable) as well.
Best regards,
IsmaelJuly 13, 2022 at 8:01 am #1358161Hi Ismael,
thanks for your feedback.
This is my table https://snipboard.io/0MkGVR.jpg. You can find it under https://afm.burde.media/transporttechnik/krantechnik/palfinger-epsilon/#m-serie
And this is the table it should look alike https://snipboard.io/yEbeFZ.jpg.
You can find it under https://www.palfingerepsilon.com/de_DE/Holzwirtschaft/Holztransport/M-Serie-EpsolutionIt’s about the headline.
The settings related to the scrollable table also only work on the mobile version.
As in my example, I would like the table to be scrollable on the desktop version as well. The first column (description column) should be fixed, the rest scrollable. Here is an illustration https://snipboard.io/qTBOiR.jpgThanks for your help
Regards,
Andy- This reply was modified 2 years, 4 months ago by burdeMedia.
- This reply was modified 2 years, 4 months ago by burdeMedia. Reason: Changing links
July 16, 2022 at 2:07 am #1358564Hi,
Thanks for your question, in order to make your heading rows span across multiple columns the table would use the colspan attribute, unfortunately, the Enfold table element doesn’t offer this feature and considering that you are also looking for advanced fixed columns and rows when scrolling I would recommend looking for a table plugin that offers these features.
I did find a stackoverflow example: Set colspan dynamically with jQuery to use as a base to try this with our table element, but please note that it will not work for the mobile table view.
The script works by removing the empty cells and adding the colspan attribute to the first cell with text, also the very first cell is ignored.
the result:
If you want to try this add this code to the end of your child theme functions.php file in Appearance ▸ Editor:function custom_colspan_script() { ?> <script> window.addEventListener('DOMContentLoaded', function() { (function($){ $('#colspantest .avia-heading-row').each(function() { var tr = this; var counter = 0; var strLookupText = ''; $('th', tr).each(function(index, value) { var th = jQuery(this); if ((th.text() == strLookupText) || (th.text() == "")) { counter++; th.prev().attr('colSpan', '' + parseInt(counter + 1,10) + '').css({textAlign : 'center'}); th.remove(); } else { counter = 0; } strLookupText = th.text(); }); }); })(jQuery); }); </script> <?php } add_action('wp_footer', 'custom_colspan_script');
and add the custom ID colspantest to the table element
Best regards,
Mike -
AuthorPosts
- You must be logged in to reply to this topic.