Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #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-Epsolution

    Right now this is my version of the table:
    https://afm.burde.media/transporttechnik/krantechnik/palfinger-epsilon/#m-serie

    The 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

    #1358142

    Hey 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,
    Ismael

    #1358161

    Hi 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-Epsolution

    It’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.jpg

    Thanks 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
    #1358564

    Hi,
    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.
    2022-07-15_007.jpg
    the result:
    2022-07-15_008.jpg
    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

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.