Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

How are p-header and ptemplate = header treated differently?


Asked by Lucca Pace on Dec 05, 2021 FAQ



Currently, in a Dialog component, <p-header> and <ng-template pTemplate="header"> behave differently. If you use <p-header>, then its content will be rendered using the p-dialog-title class, in the same way as a header attribute value would be rendered.
Indeed,
If you use <p-header>, then its content will be rendered using the p-dialog-title class, in the same way as a header attribute value would be rendered. But if you use <ng-template pTemplate="header"> then the header content will not get this class. This is because the p-dialog template is defined like:
Consequently, A header is the top margin of each page, and a footer is the bottom margin of each page. Headers and footers are useful for including material that you want to appear on every page of a document such as your name, the title of the document, or page numbers.
In respect to this,
For professional papers, the page header consists of the page number and running head. The page header appears within the top margin of every page of the paper. For student papers, the page header consists of the page number only.
In fact,
1. First, double click the header area. 2. If you want a unique header on the first page, and another header on other pages, then check Different First Page in Design ( Header & Footer Tools) tab. Or you can check Different Odd & Even Pages to insert different headers on odd pages and even pages separately.