I have a very weird issue with table cell.
My previous post How to append element to another element using php
My code is like the following
$dom = new DomDocument();
$dom->loadHTML($html]);
$tbodies = $dom->getElementsByTagName('tbody');
foreach ($tbodies as $tbody) {
$table = $dom->createElement('table');
$table->setAttribute('width',500);
$table->setAttribute('style','border:2px solid #8C8C8C;text-align:center;table-layout:fixed; border-collapse:separate;');
$tbody->parentNode->replaceChild($table, $tbody);
$table->appendChild($tbody);
}
$returnText .=$dom->saveHTML();
From my previous pose, I got my answer but it seems like the new html table doesn't have border in the table cell.
So my table like
___________
|cell cell |
|cell cell |
|___________|
but I want every cell has border. I am sure my original html table cell has no inline style addressing cell border too.
Can anyone helps?
Thanks!