Disregard Headers in Pagination

Disregard Headers in Pagination

marshall1969marshall1969 Posts: 3Questions: 1Answers: 0

I have tables that use multiple headers. So, in the pagination they get counted as an entry — instead of 1 of 3 entries I get 1 of 4 entries because my second header is getting counted as a data row. How can I have the pagination sequence ignore this?

https://www.2lraceservices.com/results-events

Answers

  • marshall1969marshall1969 Posts: 3Questions: 1Answers: 0

    Here is the HTML, I don't want my month headers calculated when showing pagination numbers. The TR class "month" is a pseudo header and is getting tabulated when figuring the number of rows being viewed.

     <tr class="month">
             <th>January</th>
    <th></th>
    <th></th>
    <th></th>
             </tr>
    
  • kthorngrenkthorngren Posts: 21,342Questions: 26Answers: 4,954

    Datatables sees those rows as table rows, not header rows, as they are in the tbody.

    RowGroup might be a good option, like this example. You will need to change your table to remove the "header" row. For example:
    http://live.datatables.net/jakuhiki/1/edit

    The example uses rowGroup.dataSrc as a function to allow for converting the date, 1/13/2023 for example, to the month name.

    Kevin

  • marshall1969marshall1969 Posts: 3Questions: 1Answers: 0

    THANKS! That works perfectly

Sign In or Register to comment.