How to use HTML to print header and footer on every printed page of a document?

前端 未结 20 1674
迷失自我
迷失自我 2020-11-21 16:51

Is it possible to print HTML pages with custom headers and footers on each printed page?

I\'d like to add the word \"UNCLASSIFIED\" in Red, Arial, size 16pt to the t

20条回答
  •  耶瑟儿~
    2020-11-21 16:57

    I found one solution. The basic idea is to make a table and in thead section place the data of header in tr and by css force to show that tr only in print not in screen then your normal header should be force to show only in screen not in print. 100% working on many pages print. sample code is here

    
    
    COMPANY NAME FOR SCREEN
    DESCRIPTION FOR SCREEN
    COMPANY NAME FOR PRINT
    DESCRIPTION FOR PRINT
    Column 1 Column 2 Column 3
    1-1 1-2 1-3
    2-1 2-2 2-3

提交回复
热议问题