Hello,
We have run your sample and then opened the output with MS Word 2007 to MS Word 2016 and in all cases, border-collapse works perfectly. The included sample Core/embedHTML/sample_1.php illustrates using this option.
LibreOffice and OpenOffice don't handle cell margins as OOXML (DOCX standard) sets. To get the same output you need to apply cell borders using CSS styles or apply a custom table style when importing HTML.
Regards.