blob: d8f7a50f8a6ce9a43a1e0c324eaa8121f197e72c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
## Description
You could add header and footer to the sheet, even with the templating of excel.
## Code
```ruby
require 'axlsx'
p = Axlsx::Package.new
wb = p.workbook
header_footer = {
different_first: false,
odd_header: '&L&F : &A&R&D &T',
odd_footer: '&C&Pof&N'
}
wb.add_worksheet(name: 'Header & Footer', header_footer: header_footer) do |sheet|
sheet.add_row ['this sheet has a header and a footer']
end
p.serialize 'header_footer_example.xlsx'
```
## Output

|