Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to print scrollable DIV content

There is a website that I would like to print the div content of. The problem is that the div is scrollable and I'm not able to print all the content. I've tried display:none on all the divs except the one I want to print and then used the Awesome Screenshot extension for Google Chrome but it won't scroll just that div.

I've read about using Javascript in the HTML, I'm guessing, but I don't know how to use that code. It's not my website so how do I inject that code so that it will print the content?

like image 275
tazboy Avatar asked May 31 '13 01:05

tazboy


People also ask

How do I print a scrollable page?

Open the web page. 2. Press Ctrl + A 3. Right click on the page and left click on “Print” 4.

How do I scroll text in a div?

For vertical scrollable bar use the x and y axis. Set the overflow-x:hidden; and overflow-y:auto; that will automatically hide the horizontal scroll bar and present only vertical scrollbar. Here the scroll div will be vertically scrollable.

How do I save a scrolling webpage as a PDF?

Save a Web Page as a PDF in Google Chrome Then click the Options (ellipsis) button in the upper-right corner of the screen. Scroll down and click Print from the menu. Next, a screen will open up. From the dropdown menu under the Destination header in the right column select Save as PDF.


1 Answers

I'm not sure what website you're using - but in IE you can open up F12 Developer tools, find the div you want to display, and modify the style on the fly:

{
display: block;
width: auto;
height: auto;
overflow: visible;
}

It would then cause the div to display all it's content, without scrollbars... hopefully this helps!

like image 124
Porschiey Avatar answered Oct 05 '22 04:10

Porschiey