We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Problem reading HTML td tags with "rowspan" attribute

I have a simple program which converts HTML files into PDF files using Words (version 3.5.3.0). Whenever an HTML file has a table which has 1 or more “td” tags which contain a “rowspan” attribute, then the resulting table is displayed incorrectly. Specifically, all of the “td” cells on the row below the one with the cell with the “rowspan” tag (or more rows, if the rowspan value is greater than 2) are incorrectly positioned to the left by 1 column (or more, if there are more than 1 cells with rowspan attributes), and an extra “empty” cell is placed at the end of the row. It appears that when the rows following the one with the rowspan are rendered, the fact that the previous row has cells spanning into those rows is being ignored.

Here is some VB.Net code I am using to recreate the problem - it is saving to HTML format rather than PDF due to simplicity, but the results are the same:

doc = New Document(HtmlFileBefore, LoadFormat.FormatHtml, "")
doc.Save(HtmlFileAfter, SaveFormat.FormatHtml)

Here is the HTML file text (just a test file to recreate the problem):

<p>
    TABLE #1 [3x2, rowspan=2]
    <table border="1" cellpadding="1" cellspacing="1">
        <tr>
            <td rowspan="2">Row 1-2, Col 1</td>
            <td>Row 1, Col 2</td>
            <td>Row 1, Col 3</td>
        </tr>
        <tr>
            <td>Row 2, Col 2</td>
            <td>Row 2, Col 3</td>
        </tr>
    </table>
</p>
<br />
<p>
    TABLE #2 [5x2, rowspan=2]
    <table border="1" cellpadding="1" cellspacing="1">
        <tr>
            <td rowspan="2">Row 1-2, Col 1</td>
            <td>Row 1, Col 2</td>
            <td>Row 1, Col 3</td>
            <td>Row 1, Col 4</td>
            <td>Row 1, Col 5</td>
        </tr>
        <tr>
            <td>Row 2, Col 2</td>
            <td>Row 2, Col 3</td>
            <td>Row 2, Col 4</td>
            <td>Row 2, Col 5</td>
        </tr>
    </table>
</p>
<br />
<p>
    TABLE #3 [3x3, rowspan=3]
    <table border="1" cellpadding="1" cellspacing="1">
        <tr>
            <td rowspan="3">Row 1-3, Col 1</td>
            <td>Row 1, Col 2</td>
            <td>Row 1, Col 3</td>
        </tr>
        <tr>
            <td>Row 2, Col 2</td>
            <td>Row 2, Col 3</td>
        </tr>
        <tr>
            <td>Row 3, Col 2</td>
            <td>Row 3, Col 3</td>
        </tr>
    </table>
</p>
<br />
<p>
    TABLE #4 [4x2, rowspan=2/rowspan=2]
    <table border="1" cellpadding="1" cellspacing="1">
        <tr>
            <td rowspan="2">Row 1-2, Col 1</td>
            <td rowspan="2">Row 1-2, Col 2</td>
            <td>Row 1, Col 3</td>
            <td>Row 1, Col 4</td>
        </tr>
        <tr>
            <td>Row 2, Col 3</td>
            <td>Row 2, Col 4</td>
        </tr>
    </table>
</p>

Thanks,

Brett

Hi Brett,

We’ve logged this as issue #926. We will keep you posted about progress of fixing.

We have tests for rowspan and colspan that work okay for us. Apparently you have a combination that does not work. Sorry there is no fix in the upcoming Aspose.Words 3.6, but we will address the issue in the future.

Can you please post examples of rowspan that DO work?? Maybe that would help us find a work-around solution that we can use.

This issue is highly problematic since a number of our tables that we are converting dynamically to PDF use rowspan. We are having to delay development of a large informational portion of our website until we can get this matter resolved in some manner. I was initially impressed with Aspose’s response time (back in January), but this response and response time is gravely underwhelming.

Joe F.
http://www.AutomatedPensions.com
the area in which we are trying to implement the Aspose PDF solution is http://www.AutomatedPensions.com/edu

We will have a look at issue in the next 2-3 days.

Hi,

We’ve released Aspose.Words 3.6.1. Sorry for inconveniences and delay.

  • Fixed handling of the “rowspan” attribute during HTML import.

https://docs.aspose.com/words/net/release-notes/

**Hi DmitryV

I am having the same issue, using Aspose.Words .NET 5.2.2.0

I have a td tag with rowspan=“4”. When aspose.words imports this, it fails to render the rowspan - causing the table to look a mess.

Are you able to provide a working example solution? As uploading my code is very difficult for me.

Cheers

Luke**

Ok attached is a solution that demonstrates the issue I am having.

I hope this helps.

Thanks heaps

Luke

Hi

Thanks for your inquiry. I managed to reproduce the problem and created new issue #6055 in our defect database. I will notify you as soon as it is fixed.

It seems that problem is caused by padding-left.

Best regards.

Hello!

I have played with this case and found the approach how rowspan problem can be overcome. Please try loading or converting this minimal sample:

rowspan=2 1.2
2.2

Of course we’ll try to fix general case in the future. But this might take considerable time. Let me know if you can build a workaround using this idea.

Regards,

Hi Viktor

Unfortunately this is not a viable workaround for us, the html comes from a database and it is not acceptable for this to be modified in any way.

This is a critical problem for us, can you possibly fast-track the resolution? Do you have an ETA for the fix?

Thanks

Luke

Hi

Thanks for your inquiry. Currently we can’t provide you any estimate. Please expect a reply before next hotfix (within 3-4 weeks). As a workaround you can parse your HTML before inserting it into the document.

Best regards.

Hi Alexey

Thanks, we await your hotfix for this issue. Please ensure you post on this thread as soon as the issue is resolved so I can download the hotfix.

Regards

Luke

Hello!

Thank you for your patience. Of course we’ll post here on any progress. We have back-links from issues in the defect database to the forum threads.

If you have any other information on this case please share it with us. This will help to provide the solution sooner.

Regards,

The issues you have found earlier (filed as WORDSNET-1818) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan