How to add page header with project data and logo that repeats on each page? #389
Proektsoftbg
started this conversation in
Show and tell
Replies: 1 comment
-
If the file is more than 2 pages the table overlaps the text: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
I recieved this question many times recently, so I decided to create such an example for everyone.
We know that Calcpad supports Html, so implement our header as an Html table. But how to make it appear on each page automatically? The good news is that this is a built-in feature of Html tables. If a table has a
<thead>
and a<tbody>
that spans accross several pages, the browser engine will automatically repeat the<thead>
content on each page. So, we will add such a<thead>
element with the project data inside and a<tbody>
element with a single row and cell that will contain the entire code for our worksheet.To demonstrate how it works, I created a sample template:
https://github.com/Proektsoftbg/Calcpad/tree/main/Examples/Demos/Page%20header%20with%20logo
You can download the above code for free, and modify it as you want, according to your needs. The best way to use it, is to wrap the code into macro variables/functions and save it as a module. Then you can include the module in all other project worksheets and insert the macros:
hashtag#include Header.cpd
header_start$
'Your worksheet content goes here.
header_end$
After that, once you change any common project data, it will reflect in all project worksheets.
Beta Was this translation helpful? Give feedback.
All reactions