PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0
Showing posts with label opera. Show all posts
Showing posts with label opera. Show all posts

Thursday, September 15, 2022

[FIXED] How to print page number in Chrome and Opera

 September 15, 2022     css, html, opera, printing     No comments   

Issue

I have a web app. I'm using Chrome and Opera on that app.
I want to put the page number in the print page preview in a specific td form like this:

<thead>
    <tr>
        <td>thead data</td>
        <td>thead data</td>
        <td>page number of pages numbers</td>
    </tr>
</thead>
<tbody>
    <tr>
        <td>tbody data</td>
        <td>tbody data</td>
        <td>tbody data</td>
    </tr>
</tbody>

In Firefox I tried this answer on StackOverflow.
It worked only in Firefox.
But my problem is that I want it in Chrome and Opera.
I've tried many things but nothing works.


Solution

To print page numbers you've to set Chrome and Opera print settings.

Click Ctrl + P and a popup will appear. Click on More Settings button and check the Header & Footer and it will show the page numbers.



Answered By - Muhammad Awais Iqbal
Answer Checked By - David Marino (PHPFixing Volunteer)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Monday, July 18, 2022

[FIXED] How to find page width in Opera 12 (for Desktop Windows)?

 July 18, 2022     browser-detection, cross-browser, document-body, javascript, opera     No comments   

Issue

I want to access full page width & height in Opera. Note I am not asking about Viewport's height or width, I want page's/document's width & height. I am using Opera 12.12

I have tried the following:

  1. document.body.scrollWidth/Height
  2. document.body.offsetWidth/Height
  3. window.innerWidth/Height
  4. document.body.clientWidth/Height

And all of them gives viewport's width/height.

Please use the following link: http://jsfiddle.net/RQhYR/

Or use the following HTML Page

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
<html>
<body>
    <div style="width:2000px;height:2000px;background-color: blue;"></div>
</body>
<script type="text/javascript">
    alert(window.outerWidth + "," + window.outerHeight);
</script>
</html>

Solution

I'm getting the correct values from body.offsetWidth/Height, body.scrollWidth/Height and body.clientWidth/Height (using the same build as you). Only window.innerWidth/Height is supposed to return browser window viewport.

Maybe you've got some odd CSS that sets the dimensions of the body to the viewport and puts the scrollbar on an element somewhere inside. In your case, I'm getting the expected values of 2000 x 2000 px from the scrollWidth/Height of the <html>, see demo.



Answered By - Bergi
Answer Checked By - Gilberto Lyons (PHPFixing Admin)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Older Posts Home

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
All Comments
Atom
All Comments

Copyright © PHPFixing