diff --git a/src/PhpSpreadsheet/Writer/Html.php b/src/PhpSpreadsheet/Writer/Html.php
index d626e9c4..c075329d 100644
--- a/src/PhpSpreadsheet/Writer/Html.php
+++ b/src/PhpSpreadsheet/Writer/Html.php
@@ -62,6 +62,13 @@ class Html extends BaseWriter
*/
private $useInlineCss = false;
+ /**
+ * Use embedded CSS?
+ *
+ * @var bool
+ */
+ private $useEmbeddedCSS = true;
+
/**
* Array of CSS styles.
*
@@ -1105,7 +1112,9 @@ class Html extends BaseWriter
// Construct HTML
$html = '';
- $html .= $this->setMargins($pSheet);
+ if ($this->useEmbeddedCSS) {
+ $html .= $this->setMargins($pSheet);
+ }
if (!$this->useInlineCss) {
$gridlines = $pSheet->getShowGridlines() ? ' gridlines' : '';
@@ -1492,6 +1501,30 @@ class Html extends BaseWriter
return $this;
}
+ /**
+ * Get use embedded CSS?
+ *
+ * @return bool
+ */
+ public function getUseEmbeddedCSS()
+ {
+ return $this->useEmbeddedCSS;
+ }
+
+ /**
+ * Set use embedded CSS?
+ *
+ * @param bool $pValue
+ *
+ * @return HTML
+ */
+ public function setUseEmbeddedCSS($pValue)
+ {
+ $this->useEmbeddedCSS = $pValue;
+
+ return $this;
+ }
+
/**
* Add color to formatted string as inline style.
*