jQuery change page-break-inside in to break-inside












3















First, I apologize for Strange English.



I'm Using Jquery 1.9 With Chrome 70, Extjs 4



I just use jQuery function css() for give 'page-break-inside:avoid'



but element style changed to 'break-inside:avoid'



try



 $($(tr).find('iframe').contents()).find('table').each(function(index,tableDOM){
$(tableDOM).css('page-break-inside','avoid');
});


expected



<table border="1" cellpadding="1" cellspacing="1" style="width:500px; page-break-inside:avoid">


result



<table border="1" cellpadding="1" cellspacing="1" style="width:500px; break-inside:avoid">


I don't know why this happen. I need 'page-break-inside' not 'break-inside' because evopdf doesn't cognize 'break-inside'



Could I have missed something?



I would appreciate your help. Thank you










share|improve this question



























    3















    First, I apologize for Strange English.



    I'm Using Jquery 1.9 With Chrome 70, Extjs 4



    I just use jQuery function css() for give 'page-break-inside:avoid'



    but element style changed to 'break-inside:avoid'



    try



     $($(tr).find('iframe').contents()).find('table').each(function(index,tableDOM){
    $(tableDOM).css('page-break-inside','avoid');
    });


    expected



    <table border="1" cellpadding="1" cellspacing="1" style="width:500px; page-break-inside:avoid">


    result



    <table border="1" cellpadding="1" cellspacing="1" style="width:500px; break-inside:avoid">


    I don't know why this happen. I need 'page-break-inside' not 'break-inside' because evopdf doesn't cognize 'break-inside'



    Could I have missed something?



    I would appreciate your help. Thank you










    share|improve this question

























      3












      3








      3


      0






      First, I apologize for Strange English.



      I'm Using Jquery 1.9 With Chrome 70, Extjs 4



      I just use jQuery function css() for give 'page-break-inside:avoid'



      but element style changed to 'break-inside:avoid'



      try



       $($(tr).find('iframe').contents()).find('table').each(function(index,tableDOM){
      $(tableDOM).css('page-break-inside','avoid');
      });


      expected



      <table border="1" cellpadding="1" cellspacing="1" style="width:500px; page-break-inside:avoid">


      result



      <table border="1" cellpadding="1" cellspacing="1" style="width:500px; break-inside:avoid">


      I don't know why this happen. I need 'page-break-inside' not 'break-inside' because evopdf doesn't cognize 'break-inside'



      Could I have missed something?



      I would appreciate your help. Thank you










      share|improve this question














      First, I apologize for Strange English.



      I'm Using Jquery 1.9 With Chrome 70, Extjs 4



      I just use jQuery function css() for give 'page-break-inside:avoid'



      but element style changed to 'break-inside:avoid'



      try



       $($(tr).find('iframe').contents()).find('table').each(function(index,tableDOM){
      $(tableDOM).css('page-break-inside','avoid');
      });


      expected



      <table border="1" cellpadding="1" cellspacing="1" style="width:500px; page-break-inside:avoid">


      result



      <table border="1" cellpadding="1" cellspacing="1" style="width:500px; break-inside:avoid">


      I don't know why this happen. I need 'page-break-inside' not 'break-inside' because evopdf doesn't cognize 'break-inside'



      Could I have missed something?



      I would appreciate your help. Thank you







      javascript jquery






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 21 '18 at 10:43









      M_YKM_YK

      4518




      4518
























          1 Answer
          1






          active

          oldest

          votes


















          1














          Very strange indeed. You can work around it if you manually set the attribute style using .attr()



          $(tableDOM).attr('style','page-break-inside:avoid');





          //$('table').css('page-break-inside','avoid');
          $('table').attr('style','page-break-inside:avoid; width:500px;');

          table
          {
          border: 1px solid grey;
          border-collapse: collapse;
          }

          td,th
          {
          border: 1px solid grey;
          padding: 10px;
          }

          <table>
          <tr><th>a</th><th>b</th><th>c</th><th>d</th><th>e</th></tr>
          <tr><td>0</td><td>1</td><td>2</td><td>3</td><td>4</td></tr>
          </table>

          <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>








          share|improve this answer


























          • But it remove another style property

            – Mohammad
            Nov 21 '18 at 10:56











          • @Mohammad then add all other style attributes together

            – Ahmad
            Nov 21 '18 at 10:57











          • As you can see in OP table has width:500px in style

            – Mohammad
            Nov 21 '18 at 10:59











          • @Mohammad Edited my answer. Thanks

            – Ahmad
            Nov 21 '18 at 11:00











          • @Ahmad Thanks for nice Answer. still I don't know why 'page-break-inside' change to 'break-inside' but I solved problem. Thank you!

            – M_YK
            Nov 22 '18 at 0:16











          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%2f53410333%2fjquery-change-page-break-inside-in-to-break-inside%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









          1














          Very strange indeed. You can work around it if you manually set the attribute style using .attr()



          $(tableDOM).attr('style','page-break-inside:avoid');





          //$('table').css('page-break-inside','avoid');
          $('table').attr('style','page-break-inside:avoid; width:500px;');

          table
          {
          border: 1px solid grey;
          border-collapse: collapse;
          }

          td,th
          {
          border: 1px solid grey;
          padding: 10px;
          }

          <table>
          <tr><th>a</th><th>b</th><th>c</th><th>d</th><th>e</th></tr>
          <tr><td>0</td><td>1</td><td>2</td><td>3</td><td>4</td></tr>
          </table>

          <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>








          share|improve this answer


























          • But it remove another style property

            – Mohammad
            Nov 21 '18 at 10:56











          • @Mohammad then add all other style attributes together

            – Ahmad
            Nov 21 '18 at 10:57











          • As you can see in OP table has width:500px in style

            – Mohammad
            Nov 21 '18 at 10:59











          • @Mohammad Edited my answer. Thanks

            – Ahmad
            Nov 21 '18 at 11:00











          • @Ahmad Thanks for nice Answer. still I don't know why 'page-break-inside' change to 'break-inside' but I solved problem. Thank you!

            – M_YK
            Nov 22 '18 at 0:16
















          1














          Very strange indeed. You can work around it if you manually set the attribute style using .attr()



          $(tableDOM).attr('style','page-break-inside:avoid');





          //$('table').css('page-break-inside','avoid');
          $('table').attr('style','page-break-inside:avoid; width:500px;');

          table
          {
          border: 1px solid grey;
          border-collapse: collapse;
          }

          td,th
          {
          border: 1px solid grey;
          padding: 10px;
          }

          <table>
          <tr><th>a</th><th>b</th><th>c</th><th>d</th><th>e</th></tr>
          <tr><td>0</td><td>1</td><td>2</td><td>3</td><td>4</td></tr>
          </table>

          <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>








          share|improve this answer


























          • But it remove another style property

            – Mohammad
            Nov 21 '18 at 10:56











          • @Mohammad then add all other style attributes together

            – Ahmad
            Nov 21 '18 at 10:57











          • As you can see in OP table has width:500px in style

            – Mohammad
            Nov 21 '18 at 10:59











          • @Mohammad Edited my answer. Thanks

            – Ahmad
            Nov 21 '18 at 11:00











          • @Ahmad Thanks for nice Answer. still I don't know why 'page-break-inside' change to 'break-inside' but I solved problem. Thank you!

            – M_YK
            Nov 22 '18 at 0:16














          1












          1








          1







          Very strange indeed. You can work around it if you manually set the attribute style using .attr()



          $(tableDOM).attr('style','page-break-inside:avoid');





          //$('table').css('page-break-inside','avoid');
          $('table').attr('style','page-break-inside:avoid; width:500px;');

          table
          {
          border: 1px solid grey;
          border-collapse: collapse;
          }

          td,th
          {
          border: 1px solid grey;
          padding: 10px;
          }

          <table>
          <tr><th>a</th><th>b</th><th>c</th><th>d</th><th>e</th></tr>
          <tr><td>0</td><td>1</td><td>2</td><td>3</td><td>4</td></tr>
          </table>

          <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>








          share|improve this answer















          Very strange indeed. You can work around it if you manually set the attribute style using .attr()



          $(tableDOM).attr('style','page-break-inside:avoid');





          //$('table').css('page-break-inside','avoid');
          $('table').attr('style','page-break-inside:avoid; width:500px;');

          table
          {
          border: 1px solid grey;
          border-collapse: collapse;
          }

          td,th
          {
          border: 1px solid grey;
          padding: 10px;
          }

          <table>
          <tr><th>a</th><th>b</th><th>c</th><th>d</th><th>e</th></tr>
          <tr><td>0</td><td>1</td><td>2</td><td>3</td><td>4</td></tr>
          </table>

          <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>








          //$('table').css('page-break-inside','avoid');
          $('table').attr('style','page-break-inside:avoid; width:500px;');

          table
          {
          border: 1px solid grey;
          border-collapse: collapse;
          }

          td,th
          {
          border: 1px solid grey;
          padding: 10px;
          }

          <table>
          <tr><th>a</th><th>b</th><th>c</th><th>d</th><th>e</th></tr>
          <tr><td>0</td><td>1</td><td>2</td><td>3</td><td>4</td></tr>
          </table>

          <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>





          //$('table').css('page-break-inside','avoid');
          $('table').attr('style','page-break-inside:avoid; width:500px;');

          table
          {
          border: 1px solid grey;
          border-collapse: collapse;
          }

          td,th
          {
          border: 1px solid grey;
          padding: 10px;
          }

          <table>
          <tr><th>a</th><th>b</th><th>c</th><th>d</th><th>e</th></tr>
          <tr><td>0</td><td>1</td><td>2</td><td>3</td><td>4</td></tr>
          </table>

          <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 21 '18 at 11:00

























          answered Nov 21 '18 at 10:54









          AhmadAhmad

          8,31043664




          8,31043664













          • But it remove another style property

            – Mohammad
            Nov 21 '18 at 10:56











          • @Mohammad then add all other style attributes together

            – Ahmad
            Nov 21 '18 at 10:57











          • As you can see in OP table has width:500px in style

            – Mohammad
            Nov 21 '18 at 10:59











          • @Mohammad Edited my answer. Thanks

            – Ahmad
            Nov 21 '18 at 11:00











          • @Ahmad Thanks for nice Answer. still I don't know why 'page-break-inside' change to 'break-inside' but I solved problem. Thank you!

            – M_YK
            Nov 22 '18 at 0:16



















          • But it remove another style property

            – Mohammad
            Nov 21 '18 at 10:56











          • @Mohammad then add all other style attributes together

            – Ahmad
            Nov 21 '18 at 10:57











          • As you can see in OP table has width:500px in style

            – Mohammad
            Nov 21 '18 at 10:59











          • @Mohammad Edited my answer. Thanks

            – Ahmad
            Nov 21 '18 at 11:00











          • @Ahmad Thanks for nice Answer. still I don't know why 'page-break-inside' change to 'break-inside' but I solved problem. Thank you!

            – M_YK
            Nov 22 '18 at 0:16

















          But it remove another style property

          – Mohammad
          Nov 21 '18 at 10:56





          But it remove another style property

          – Mohammad
          Nov 21 '18 at 10:56













          @Mohammad then add all other style attributes together

          – Ahmad
          Nov 21 '18 at 10:57





          @Mohammad then add all other style attributes together

          – Ahmad
          Nov 21 '18 at 10:57













          As you can see in OP table has width:500px in style

          – Mohammad
          Nov 21 '18 at 10:59





          As you can see in OP table has width:500px in style

          – Mohammad
          Nov 21 '18 at 10:59













          @Mohammad Edited my answer. Thanks

          – Ahmad
          Nov 21 '18 at 11:00





          @Mohammad Edited my answer. Thanks

          – Ahmad
          Nov 21 '18 at 11:00













          @Ahmad Thanks for nice Answer. still I don't know why 'page-break-inside' change to 'break-inside' but I solved problem. Thank you!

          – M_YK
          Nov 22 '18 at 0:16





          @Ahmad Thanks for nice Answer. still I don't know why 'page-break-inside' change to 'break-inside' but I solved problem. Thank you!

          – M_YK
          Nov 22 '18 at 0:16




















          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%2f53410333%2fjquery-change-page-break-inside-in-to-break-inside%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

          How to change which sound is reproduced for terminal bell?

          Can I use Tabulator js library in my java Spring + Thymeleaf project?

          Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents