synistar has asked for the wisdom of the Perl Monks concerning the following question:
I need to convert many (over 150) HTML pages that use table layouts into something usable with a predefined set of style sheets. These pages use no paragraph or div tags. They are entirely laid out with tables and table cells.
Here is an example table. I need to remove all the table mark up and place all the TDs labeled Column 1 into a div. Then I need to place all the cells labeled Column 2 into another div. I would like to do this in perl to avoid lots of tedious hand editing of the files.
| Column 1 Title | Column 2 Title | ||
| Column 1 content | Column 1 content | Column 2 content | Column 2 content |
| Column 1 content | Column 1 content | Column 2 Footer | |
Simply doing a search and replace on the TD tags results in the contents of the two columns coming out intermingled.
To make things even worse the layouts are not consistent so the perl code would need to recognize colspan attributes. Does anyone know of a module or script that already does something like this?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Converting HTML Table Layouts (Linearizing Tables)
by Limbic~Region (Chancellor) on Mar 19, 2004 at 15:48 UTC | |
|
Re: Converting HTML Table Layouts (Linearizing Tables)
by halley (Prior) on Mar 19, 2004 at 15:46 UTC | |
|
Re: Converting HTML Table Layouts (Linearizing Tables)
by Aristotle (Chancellor) on Mar 20, 2004 at 09:35 UTC |