OL Learn

Conditional text in print context based on page number


I would like to know if it is possible to have a conditional text for a print context based on a page number.
There is a block of text (together with a table) that I only want to show on the first page but not any other pages afterwards.
I have tried to place everything in a Master page but this is not possible since a table is not properly handled in a Master page and instead I just get one line instead of all my lines.

Where is the block of text…before, inside or after the dynamic table?

The page break algorithm is physically creating a table for each page the table runs on. This means we could utilize CSS to add content after the first table (for example by selecting it’s class). Consider the following CSS code:

.table-grid:first-of-type:after {
	content: "Hello world!";
	display: block;
	padding-top: 0.5em;

The selector is locates the first table with class .table-grid and sets the content using the :after pseudo selector.

It is not very elegant but seems to do the trick (assuming the text is a static string).

Hope this helps,