JavaScript how can we prevent a block from being printed across different pages prevent inline block from wrapping,magento prevent block from caching,

There is no good general solution. As some have pointed out, you can put a page break before <div> "B" ... but there you will always get it. Even when "A" and "B" all fit on one page.

You can use page-break-inside="avoid" on <div> "B". This is probably closer to what you want. If "B" does not fit on the page with "A", "B" will all be moved to the next page.

BUT ... that has a side effect because there is a third possibility. What if the content of "B" is so large that it itself does not fit on a page? WHat will happen is that it would do what you think, moving "B" to the next page and try to build that page with "B". It will not be able to meet the condition that "B" avoid a page break inside so it will break that condition. Unfortunately, it would not figure that out until the end of the page, so you will end up with a blank page.

If you know that "B" will always fit on one page, then you can use page-break-inside="avoid" and that would work. But if it does not, nothing will work for you.

A slightly more lengthy explanation for a similar question is here:

HTML/CSS: empty page + only header page when printing table

So what you actually want is three things in one... (1) you would like it avoid a page-break inside as long as it is not longer than a page, otherwise, (2) you want a page break before (3) unless it fits on the current page. Unfortunately, this does not exist. You could only do that with Javascript. You could set the width for the page for the div's and then get the height of div "A" and div "B" and then make a decision to dynamically insert those CSS properties as part of the print process.

Answer:1

You might want to use some print stylesheet with cm or pt units for your elements, so you can adjust their physical size printed on paper. I'd suggest you have a look at this Post: How To Set Up A Print Style Sheet

Answer:2

I want the div to move left to right on scroll. Which I did. But, how do I make the div go to the right much faster? Because the speed of the div going from left to right is the same as the ...

I want the div to move left to right on scroll. Which I did. But, how do I make the div go to the right much faster? Because the speed of the div going from left to right is the same as the ...

  1. make mouse move left to right
  2. make parabola move left and right
  3. unity make object move left and right

I have this custom jQuery function : jQuery.fn.extend({ disable: function () { return $(this).each(function () { // function code }); } }); When I do something ...

I have this custom jQuery function : jQuery.fn.extend({ disable: function () { return $(this).each(function () { // function code }); } }); When I do something ...

  1. jquery working with json
  2. jquery working with arrays
  3. jquery working with cookies
  4. jquery working with xml
  5. jquery working with forms
  6. jquery working with this
  7. jquery not working with bootstrap
  8. jquery not working with updatepanel
  9. jquery not working with ajax loaded content
  10. jquery not working with angularjs
  11. jquery not working with dynamic content
  12. jquery not working with vue
  13. jquery not working with react
  14. jquery not working with angular
  15. jquery not working with vuejs
  16. jquery not working with ie 11
  17. jquery not working with appended elements
  18. jquery not working with angular 6
  19. jquery not working with ie
  20. jquery not working with django

When using fullscreen image gallery and blending between pictures, some images are much bigger and takes some time to load and show up. Yes, there is a function called onload which is called when ...

When using fullscreen image gallery and blending between pictures, some images are much bigger and takes some time to load and show up. Yes, there is a function called onload which is called when ...

  1. information when there
  2. is there any information when the applicant graduated

Can nested HTML list items be forced to be aligned to the left? for eg: Bat Cat Ratonetwothree Mat <ul> <li>Bat</li> <li>Cat</li> <li>...

Can nested HTML list items be forced to be aligned to the left? for eg: Bat Cat Ratonetwothree Mat <ul> <li>Bat</li> <li>Cat</li> <li>...

  1. nested html list
  2. html nested list example
  3. html nested list generator
  4. nested list html css
  5. html nested list items
  6. html nested list numbering
  7. nested list html w3schools
  8. nested list html code
  9. html nested list not indenting
  10. html nested list style
  11. nested list html program
  12. nested list html bootstrap
  13. html nested list indent
  14. html nested list without bullets
  15. html nested list exercises
  16. nested list html definition
  17. html nested list roman numerals
  18. nested list html questions
  19. html nested list not working
  20. nested list html 1.1