summaryrefslogtreecommitdiffhomepage
path: root/docs
diff options
context:
space:
mode:
authorWeston Ganger <[email protected]>2019-10-28 16:54:54 -0700
committerStefan Daschek <[email protected]>2019-10-29 01:23:33 +0100
commit2cdaed0178d95c8f0e63ae60c94cfd8bd787e5c6 (patch)
tree0090252d831ffd00729c5f4799fc5f0d2aa13700 /docs
parent76975a38e56b3cb3d13ed4e2b59afb0d2aaaef0f (diff)
downloadcaxlsx-2cdaed0178d95c8f0e63ae60c94cfd8bd787e5c6.tar.gz
caxlsx-2cdaed0178d95c8f0e63ae60c94cfd8bd787e5c6.zip
Add Style Reference
Diffstat (limited to 'docs')
-rw-r--r--docs/header_and_footer_codes.md69
-rw-r--r--docs/style_reference.md82
2 files changed, 151 insertions, 0 deletions
diff --git a/docs/header_and_footer_codes.md b/docs/header_and_footer_codes.md
new file mode 100644
index 00000000..2be4459a
--- /dev/null
+++ b/docs/header_and_footer_codes.md
@@ -0,0 +1,69 @@
+## positioning
+&L - code for "left section"
+
+&C - code for "center section".
+
+&R - code for "right section".
+
+(there are three header / footer locations, "left", "center", and "right"). When two or
+more occurrences of a section marker exist, the contents from all identical markers are concatenated, in the order of
+appearance, and placed into the section section.
+
+## font styles
+
+&font size - code for "text font size", where font size is a font size in points.
+
+&K - code for "text font color"
+ - RGB Color is specified as RRGGBB
+ - Theme Color is specified as TTSNN where TT is the theme color Id, S is either "+" or "-" of the tint/shade value, NN is the tint/shade value.
+
+&"font name,font type" - code for "text font name" and "text font type" where font name and font type
+ are strings specifying the name and type of the font, separated by a comma. When a hyphen appears
+in font name it means none specified. Both of font name and font type can be localized values.
+Although ISO/IEC 14496-22 permits commas in font family/subfamily/full names, name and font type
+, the lexically first comma in the font name is the one recognized as the separating comma.
+
+&"-,Bold" - code for "bold font style"
+
+&B - also means "bold font style".
+
+&"-,Regular" - code for "regular font style"
+
+&"-,Italic" - code for "italic font style"
+&I - also means "italic font style"
+
+&"-,Bold Italic" code for "bold italic font style"
+
+&S - code for "text strikethrough" on / off
+&X - code for "text super script" on / off
+&Y - code for "text subscript" on / off
+
+
+## Workbook info and page numbering
+
+&P - code for "current page #"
+
+&N - code for "total pages"
+
+&D - code for "date"
+
+&T - code for "time"
+
+&G - code for "picture as background"
+
+&U - code for "text single underline"
+
+&E - code for "double underline"
+
+&Z - code for "this workbook's file path"
+
+&F - code for "this workbook's file name"
+
+&A - code for "sheet tab name"
+
+&+ - code for add to page #.
+
+&- - code for subtract from page #.
+
+&O - code for "outline style"
+&H - code for "shadow style"
diff --git a/docs/style_reference.md b/docs/style_reference.md
new file mode 100644
index 00000000..01d7f008
--- /dev/null
+++ b/docs/style_reference.md
@@ -0,0 +1,82 @@
+# Basic Styling
+- `b` (Boolean) - Bold
+- `i` (Boolean) - Italic
+- `u` (Boolean) - Underline
+- `fg_color` (String) - Text Color - Ex: `000000`
+- `bg_color` (String) - Cell background color - Ex: `CCCCCC`
+- `alignment` (Hash) - Text alignment.
+ - Available sub-options are `:horizontal`, `:vertical`, `:wrap_text`.
+ - Example: `alignment: {horizontal: true, vertical: true, wrap_text: false}`
+- `strike` (Boolean) - Indicates if the text should be rendered with a strikethrough
+- `outline` (Boolean) - Indicates if the text should be rendered with a shadow
+- `sz` (Integer) - Font Size
+- `font_name` (String) - Font Name - Ex. `Arial`
+- `family` (Integer) - The font family to use. Options are:
+ - `1` - Roman (Default)
+ - `2` - Swiss
+ - `3` - Modern
+ - `4` - Script
+ - `5` - Decorative
+- `charset` (Integer) - The character set to use. Axlsx documentation says this setting is ignored most of the time.
+- `type` (Symbol) - Type of the cell. Options are: `:xf` (Default) or `:dxf`
+- `border` (Hash) - Borders support style, color and edges options. Example: `border: {style: :thin, color: "000000", edges: [:top, :bottom, :left, :right]}`. Available styles for the border are:
+ - `:none`
+ - `:thin`
+ - `:medium`
+ - `:dashed`
+ - `:dotted`
+ - `:thick`
+ - `:double`
+ - `:hair`
+ - `:mediumDashed`
+ - `:dashDot`
+ - `:mediumDashDot`
+ - `:dashDotDot`
+ - `:mediumDashDotDot`
+ - `:slantDashDot`
+- `hidden` (Boolean) - Indicates if the cell should be hidden
+- `locked` (Boolean) - Indicates if the cell should be locked
+- `format_code` (String) - See section below
+- `num_fmt` (Integer) - See section below
+
+# `format_code` and `num_fmt`
+To output a dollar sign, comma's every three values, and minumum two decimal places use:
+`format_code: '\$#,##0.00'`
+
+This will output a nicely formatted date/time:
+`m/d/yyyy h:mm:ss AM/PM`
+
+I think its much more preferable to write out the `format_code` manually instead of using `num_fmt` however the option is there.
+
+Heres a list of the `num_fmt` code (left side) and corresponding `format_code` string (right side)
+
+- `1` - `'0'`
+- `2` - `'0.00'`
+- `3` - `'#,##0'`
+- `4` - `'#,##0.00'`
+- `5` - `'$#,##0_);($#,##0)'`
+- `6` - `'$#,##0_);Red'`
+- `7` - `'$#,##0.00_);($#,##0.00)'`
+- `8` - `'$#,##0.00_);Red'`
+- `9` - `'0%'`
+- `10` - `'0.00%' `
+- `11` - `'0.00E+00'`
+- `12` - `'# ?/?'`
+- `13` - `'# ??/??'`
+- `14` - `'m/d/yyyy'`
+- `15` - `'d-mmm-yy'`
+- `16` - `'d-mmm'`
+- `17` - `'mmm-yy'`
+- `18` - `'h:mm AM/PM'`
+- `19` - `'h:mm:ss AM/PM'`
+- `20` - `'h:mm'`
+- `21` - `'h:mm:ss'`
+- `22` - `'m/d/yyyy h:mm'`
+- `37` - `'#,##0_);(#,##0) 38 #,##0_);Red'`
+- `39` - `'#,##0.00_);(#,##0.00)'`
+- `40` - `'#,##0.00_);Red'`
+- `45` - `'mm:ss'`
+- `46` - `'[h]:mm:ss'`
+- `47` - `'mm:ss.0'`
+- `48` - `'##0.0E+0'`
+- `49` - `'@'`