First stab at #135 - Add borders (#200)

Fixes #135

Added border support for ODS and XLSX files.
Updated README.
This commit is contained in:
madflow authored and Adrien Loison committed 2016-06-18 23:36:10 -07:00
1 parent 1891c0b053
commit e30bc37448
17 files changed
+871 -16

No files matched your search

+9 -1
View File
@@ -3,6 +3,7 @@
namespace Box\Spout\Writer\ODS\Helper;
use Box\Spout\Writer\Common\Helper\AbstractStyleHelper;
use Box\Spout\Writer\Style\BorderPart;
/**
* Class StyleHelper
@@ -256,9 +257,16 @@ EOD;
$content .= '<style:table-cell-properties fo:wrap-option="wrap" style:vertical-align="automatic"/>';
}
if ($style->shouldApplyBorder()) {
$borderProperty = '<style:table-cell-properties %s />';
$borders = array_map(function (BorderPart $borderPart) {
return BorderHelper::serializeBorderPart($borderPart);
}, $style->getBorder()->getParts());
$content .= sprintf($borderProperty, implode(' ', $borders));
}
$content .= '</style:style>';
return $content;
}
}