How can I convert my tables to divs
Well, I hope that it is possible to convert the and related tags to . I am
using SimpleHTMLDomParser and it is not possible to go for another parser
in this stage. Here's what I have tried:
$html=preg_replace('/<table[^>]*>/ism', '',$html);
$html=preg_replace('/<\/table>/ism', '<br/>',$html);
$html=preg_replace('/<(tr|td|th)[^>]*>/ism', '',$html);
$html=preg_replace('/<\/(tr|td|th)[^>]*>/ism', '<br/>',$html);
To strip out the tables, but now I need to convert all the
"<table>","<tr>","<td>","<th>" to (nested) "<div>" tags (the table changes
to a div, its internal tags to nested divs).
How to do that? Thanks in advance.
No comments:
Post a Comment