summaryrefslogtreecommitdiffhomepage
path: root/examples/header_footer_example.md
diff options
context:
space:
mode:
Diffstat (limited to 'examples/header_footer_example.md')
-rw-r--r--examples/header_footer_example.md28
1 files changed, 28 insertions, 0 deletions
diff --git a/examples/header_footer_example.md b/examples/header_footer_example.md
new file mode 100644
index 00000000..d8f7a50f
--- /dev/null
+++ b/examples/header_footer_example.md
@@ -0,0 +1,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
+
+![Output](images/header_footer_example.png "Output")