user2119324
user2119324

Reputation: 597

Print page content overwriting on header

page content over writing the header on the second page, please check the below code

 @media screen {
     div.divHeader
            {
                display: none;
            }
    }
    @media print {
      div.divHeader
            {
                position: fixed;
                top: 0;
            }
             div.divContent
            {
                 position: fixed;
                 top: 120px;
            }

    }

enter image description here

Upvotes: 1

Views: 136

Answers (2)

user2119324
user2119324

Reputation: 597

Got the answer, heading placed in <thead>

<table>
     <thead>
    <tr>
    <th colspan="10"><h1>My Header</h1></th></tr>
     </thead>
    <tbody>
    <tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
    </tbody>
    </table>

Upvotes: 1

Amir H. Bagheri
Amir H. Bagheri

Reputation: 1416

Yes. That's because it is fixed. Therefore, it is shown in every page. Instead, change it to the absolute position.

Upvotes: 0

Related Questions