-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Open
Description
When creating a table, a TableStyle is created with borderColor '006699'. If the table is exported in the Word2007 format, the table borders are blue, as expected. However, when exporting to a HTML format, the table does not get a border-color attribute .
This snippet shows how the table was created, and is taken almost literally from the docs:
$phpWord = new \PhpOffice\PhpWord\PhpWord();
$section = $phpWord->addSection();
$tableStyle = array(
'borderColor' => '006699',
'borderSize' => 6,
'cellMargin' => 50
);
$phpWord->addTableStyle('myTable', $tableStyle);
$table = $section->addTable('myTable');
$row = $table->addRow();
$row->addCell();
$row->addCell();
$row->addCell();
$row = $table->addRow();
$row->addCell();
$row->addCell();
$row->addCell();
$phpWord->save('Test.html', 'HTML');
When opening the created Test.html file, I'd expect the myTable css style to have a border-color: #006699 property.
If this is by design (for security reasons maybe?), I can live with the answer and implement a custom solution for my project, where I'm sure the input is not unsafe. If it's not, I'd be happy to create a failing test and supply a PR to fix it.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels