PHPOffice / PHPWord

A pure PHP library for reading and writing word processing documents
https://phpoffice.github.io/PHPWord/
Other
7.25k stars 2.69k forks source link

Table without borders in docx document show with border in HTML converted #2474

Open ddiaz427 opened 1 year ago

ddiaz427 commented 1 year ago

I am using a PHP library to read a DOCX document and convert it to HTML. The document contains two tables, but the first table doesn't have borders. The issue is that when the document is converted to HTML, the table is rendered with borders, and I don't understand why. I also tried converting it to PDF to see if the problem was with the HTML conversion, but the PDF file generated exhibits the same problem.

I would appreciate any ideas or suggestions to resolve this issue. Below is the code I am using, which is quite simple.

require 'vendor/autoload.php';

use PhpOffice\PhpWord\IOFactory;

$phpWord = IOFactory::load('test.docx', 'Word2007');

$htmlWriter = new \PhpOffice\PhpWord\Writer\HTML($phpWord);
$htmlWriter->save('test.html');
Progi1984 commented 1 year ago

@ddiaz427 Could you send me your file, please ?

ddiaz427 commented 1 year ago

This is a the file test1.docx