From 845d2a8880c2eab5382e02c65cb762ca1e42e60f Mon Sep 17 00:00:00 2001
From: Pieter Sheth-Voss <pieter@protobi.com>
Date: Sat, 28 Feb 2015 11:55:15 -0500
Subject: [PATCH] Added support for alignment

---
 bits/90_utils.js | 9 +++++++++
 xlsx.js          | 9 +++++++++
 2 files changed, 18 insertions(+)

diff --git a/bits/90_utils.js b/bits/90_utils.js
index bd8c2cf..957e61b 100644
--- a/bits/90_utils.js
+++ b/bits/90_utils.js
@@ -383,6 +383,15 @@ if ((typeof 'module' != 'undefined'  && typeof require != 'undefined') || (typeo
           $xf.attr('applyNumberFormat', "1");
         }
 
+        if (attributes.alignment) {
+          var $alignment = createElement('<alignment></alignment>');
+          if (attributes.alignment.horizontal) { $alignment.attr('horizontal', attributes.alignment.horizontal);}
+          if (attributes.alignment.vertical)  { $alignment.attr('vertical', attributes.alignment.vertical);}
+          if (attributes.alignment.indent)  { $alignment.attr('indent', attributes.alignment.indent);}
+          if (attributes.alignment.wrapText)  { $alignment.attr('wrapText', attributes.alignment.wrapText);}
+          $xf.append($alignment).attr('applyAlignment',1)
+
+        }
 
         var $cellXfs = this.$styles.find('cellXfs');
 
diff --git a/xlsx.js b/xlsx.js
index 6c412ee..9f14dc4 100644
--- a/xlsx.js
+++ b/xlsx.js
@@ -5597,6 +5597,15 @@ if ((typeof 'module' != 'undefined'  && typeof require != 'undefined') || (typeo
           $xf.attr('applyNumberFormat', "1");
         }
 
+        if (attributes.alignment) {
+          var $alignment = createElement('<alignment></alignment>');
+          if (attributes.alignment.horizontal) { $alignment.attr('horizontal', attributes.alignment.horizontal);}
+          if (attributes.alignment.vertical)  { $alignment.attr('vertical', attributes.alignment.vertical);}
+          if (attributes.alignment.indent)  { $alignment.attr('indent', attributes.alignment.indent);}
+          if (attributes.alignment.wrapText)  { $alignment.attr('wrapText', attributes.alignment.wrapText);}
+          $xf.append($alignment).attr('applyAlignment',1)
+
+        }
 
         var $cellXfs = this.$styles.find('cellXfs');