Skip to content

XLSX reader HTML writer does not support conditional formatting if using inline CSS #4539

@ccchapman

Description

@ccchapman

If you use the XLSX reader and HTML writer with the inline CSS option, conditional formatting color scale support is lost.

<?php

require 'vendor/autoload.php';

use PhpOffice\PhpSpreadsheet\IOFactory;
use PhpOffice\PhpSpreadsheet\Writer\Html;

$spreadsheet = IOFactory::load('example.xlsx');

$writer = new Html($spreadsheet);
$writer->setConditionalFormatting(true);
$writer->setUseInlineCss(true);

echo 'With `setUseInlineCss(true);`';

echo $writer->generateSheetData();

$writer->setUseInlineCss(false);

echo 'With `setUseInlineCss(false);`';

echo $writer->generateSheetData();

Steps to reproduce:

  1. Download the .zip attached here
  2. Run php -S 0.0.0.0:8080

spreadsheet-test.zip

Related: #4412

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions