How to arrange Data in html table with jquery pagination?












0















I have a html table with jquery pagination. In that table there is a column witch contains dates. I want to get same dates in a same month to a one perticular page. Likewise each pages should have same dates in a same month.
For example:
page 1 - Dates of November
page 2 - Dates of May
page 3 - Dates of April
Table data loaded from sql server database.
According to pagination 10 table records per page.
Here is my jquery code



  //Add pagination fuctionality
jQuery(document).ready(function ($) {

var myTable = document.getElementById('openDispatchNoteTable');

for (var i = 0 ; i < myTable.rows.length ; i++) {
if (myTable.rows[i].cells[6].innerText == myTable.rows[i + 1].cells[6].innerText)
console.log("date : " + myTable.rows[i].cells[6].innerText);
else
console.log("date : Not equal")
//console.log("date : " + myTable.rows[i].cells[6].innerText.split("-",3));
//console.log("date " + i);
}

for (var i = 1; i <= 500; i++) {
$('.list-group').append('<li class="list-group-item"> Item ' + i + '</li>');

}

$('.table tbody').paginathing({
limitPagination: false,
perPage: 10,
insertAfter: '.table',
containerClass: 'panel-footer'
});
});


Can you please help me to solve this problem?



Thank you.










share|improve this question





























    0















    I have a html table with jquery pagination. In that table there is a column witch contains dates. I want to get same dates in a same month to a one perticular page. Likewise each pages should have same dates in a same month.
    For example:
    page 1 - Dates of November
    page 2 - Dates of May
    page 3 - Dates of April
    Table data loaded from sql server database.
    According to pagination 10 table records per page.
    Here is my jquery code



      //Add pagination fuctionality
    jQuery(document).ready(function ($) {

    var myTable = document.getElementById('openDispatchNoteTable');

    for (var i = 0 ; i < myTable.rows.length ; i++) {
    if (myTable.rows[i].cells[6].innerText == myTable.rows[i + 1].cells[6].innerText)
    console.log("date : " + myTable.rows[i].cells[6].innerText);
    else
    console.log("date : Not equal")
    //console.log("date : " + myTable.rows[i].cells[6].innerText.split("-",3));
    //console.log("date " + i);
    }

    for (var i = 1; i <= 500; i++) {
    $('.list-group').append('<li class="list-group-item"> Item ' + i + '</li>');

    }

    $('.table tbody').paginathing({
    limitPagination: false,
    perPage: 10,
    insertAfter: '.table',
    containerClass: 'panel-footer'
    });
    });


    Can you please help me to solve this problem?



    Thank you.










    share|improve this question



























      0












      0








      0








      I have a html table with jquery pagination. In that table there is a column witch contains dates. I want to get same dates in a same month to a one perticular page. Likewise each pages should have same dates in a same month.
      For example:
      page 1 - Dates of November
      page 2 - Dates of May
      page 3 - Dates of April
      Table data loaded from sql server database.
      According to pagination 10 table records per page.
      Here is my jquery code



        //Add pagination fuctionality
      jQuery(document).ready(function ($) {

      var myTable = document.getElementById('openDispatchNoteTable');

      for (var i = 0 ; i < myTable.rows.length ; i++) {
      if (myTable.rows[i].cells[6].innerText == myTable.rows[i + 1].cells[6].innerText)
      console.log("date : " + myTable.rows[i].cells[6].innerText);
      else
      console.log("date : Not equal")
      //console.log("date : " + myTable.rows[i].cells[6].innerText.split("-",3));
      //console.log("date " + i);
      }

      for (var i = 1; i <= 500; i++) {
      $('.list-group').append('<li class="list-group-item"> Item ' + i + '</li>');

      }

      $('.table tbody').paginathing({
      limitPagination: false,
      perPage: 10,
      insertAfter: '.table',
      containerClass: 'panel-footer'
      });
      });


      Can you please help me to solve this problem?



      Thank you.










      share|improve this question
















      I have a html table with jquery pagination. In that table there is a column witch contains dates. I want to get same dates in a same month to a one perticular page. Likewise each pages should have same dates in a same month.
      For example:
      page 1 - Dates of November
      page 2 - Dates of May
      page 3 - Dates of April
      Table data loaded from sql server database.
      According to pagination 10 table records per page.
      Here is my jquery code



        //Add pagination fuctionality
      jQuery(document).ready(function ($) {

      var myTable = document.getElementById('openDispatchNoteTable');

      for (var i = 0 ; i < myTable.rows.length ; i++) {
      if (myTable.rows[i].cells[6].innerText == myTable.rows[i + 1].cells[6].innerText)
      console.log("date : " + myTable.rows[i].cells[6].innerText);
      else
      console.log("date : Not equal")
      //console.log("date : " + myTable.rows[i].cells[6].innerText.split("-",3));
      //console.log("date " + i);
      }

      for (var i = 1; i <= 500; i++) {
      $('.list-group').append('<li class="list-group-item"> Item ' + i + '</li>');

      }

      $('.table tbody').paginathing({
      limitPagination: false,
      perPage: 10,
      insertAfter: '.table',
      containerClass: 'panel-footer'
      });
      });


      Can you please help me to solve this problem?



      Thank you.







      javascript jquery html






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 20 '18 at 9:32







      Ravindu Saluwadana

















      asked Nov 20 '18 at 8:54









      Ravindu SaluwadanaRavindu Saluwadana

      167




      167
























          1 Answer
          1






          active

          oldest

          votes


















          0














          In advance, I'm sorry that this is actually a comment, but as I cannot place them yet, i'll try it this way.



          I'd rather use the library Datatables for these kind of sorting tables.
          Datatables provide a wide range of options for sorting their tables.
          Check it out here






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53389344%2fhow-to-arrange-data-in-html-table-with-jquery-pagination%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            In advance, I'm sorry that this is actually a comment, but as I cannot place them yet, i'll try it this way.



            I'd rather use the library Datatables for these kind of sorting tables.
            Datatables provide a wide range of options for sorting their tables.
            Check it out here






            share|improve this answer




























              0














              In advance, I'm sorry that this is actually a comment, but as I cannot place them yet, i'll try it this way.



              I'd rather use the library Datatables for these kind of sorting tables.
              Datatables provide a wide range of options for sorting their tables.
              Check it out here






              share|improve this answer


























                0












                0








                0







                In advance, I'm sorry that this is actually a comment, but as I cannot place them yet, i'll try it this way.



                I'd rather use the library Datatables for these kind of sorting tables.
                Datatables provide a wide range of options for sorting their tables.
                Check it out here






                share|improve this answer













                In advance, I'm sorry that this is actually a comment, but as I cannot place them yet, i'll try it this way.



                I'd rather use the library Datatables for these kind of sorting tables.
                Datatables provide a wide range of options for sorting their tables.
                Check it out here







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 20 '18 at 9:48









                TychoTycho

                335




                335






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53389344%2fhow-to-arrange-data-in-html-table-with-jquery-pagination%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    MongoDB - Not Authorized To Execute Command

                    How to fix TextFormField cause rebuild widget in Flutter

                    Npm cannot find a required file even through it is in the searched directory