Jump to content

PHP: Convert html table to XML


lilmer

Recommended Posts

I have a table that has a row and column with different style and colspan etc.

 

Does anyone know how to convert it HTML to XML file with the designated style Using PHP. Cause I going to convert it the xml to xls also.

 

<table>
<tbody>
 <tr>
   <td>1</td>
   <td>2</td>
   <td>3</td>
   <td>4</td>
   <td>5</td>
</tr>
 <tr>
   <td>1</td>
   <td>2</td>
   <td colspan='2'>34</td>
   <td>5</td>
</tr>
 <tr>
   <td stye='font-weight:bold'>BOLD</td>
   <td stye='font-style:underline'>underline</td>
   <td stye='font-stye:arial'>Italic</td>
   <td stye='font-familty:aria'>Arial</td>
<td stye='background-color:Blue'>Arial</td>
</tr>
</tbody>
</table>

Link to comment
Share on other sites

@Barand

 

Yes, my goal is to create a excel file and can be edit also on html web page, like google spreadsheet. I can already generate a .xls file to my web page and its content using phpexcelreader. My problem now is to save the existing file as I change some content on the html page. Do you think its a good idea to save the html to xml and to .xls?? do you think it will work?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.