QWebView - Pb to display HTML table with rowspan with QT5.5



  • Hello,

    I use a QWebView to display a HTML table. My program worked fine in Qt4.8 but since I use Qt5 the QWebView doesn't display the table properly. The html file is correctly displayed by a web navigator such as Firefox, IE and Chrome.

    The table appears like this in : a QWebView (Qt5.5)

    The table appears like this in : a web navigator

    As you can see it misses some borders. I have looked for QWebView properties to set but I didn't find anything relevant. It looks like "rowspan" is the source of the problem but it worked in Qt4.8. I tried using a QTextEdit but it doesn't work well neither. I didn't find other topics with some problems to migrate from QWebview in qt4.8 to Qt5.5.

    Here is the code I use to test it:

    QApplication application(argc,argv);
    QWebView qwebview;
    qwebview.load(QUrl("file:///TestHTML.html"));
    qwebview.show();
    return application.exec();
    

    Here is the HTML code:

    <html>
        <style type="text/css">
    body {  background-color:white}table {  border-style: solid;     border-width: 1px; border-collapse: collapse ;}th {    background-color:#9B9A9B;   text-align:center;  border-left:1px solid black;    border-right:1px solid black;   border-top: 1px solid black;    border-bottom: 1px solid black ;    font-size:small;    padding-left:4px;   padding-right:4px;}td {border-left:1px solid black; border-right:1px solid black; padding-left:4px ;    padding-right:4px;}td.final {   border-bottom: 1px solid black ;}</style>
        <body>
            <table width="100%" style="empty-cells:show">
                <tr>
                    <th bgcolor="#9B9A9B">text</th>
                    <th bgcolor="#9B9A9B">text</th>
                    <th bgcolor="#9B9A9B">text</th>
                    <th bgcolor="#9B9A9B">text</th>
                    <th bgcolor="#9B9A9B">text</th>
                    <th bgcolor="#9B9A9B">text</th>
                    <th bgcolor="#9B9A9B">text</th>
                    <th bgcolor="#9B9A9B">text</th>
                    <th bgcolor="#9B9A9B">text</th>
                    <th bgcolor="#9B9A9B">text</th>
                    <th bgcolor="#9B9A9B">text</th>
                </tr>
                <tr>
                    <td class="final" bgcolor="#F6F0F6" rowspan="6">text</td>
                    <td class="final" bgcolor="#F6F0F6" rowspan="6"/>
                    <td class="final" bgcolor="#F6F0F6" rowspan="6"/>
                    <td class="final" bgcolor="#F6F0F6" rowspan="6"/>
                    <td class="final" bgcolor="#F6F0F6" rowspan="6"/>
                    <td class="final" bgcolor="#F6F0F6" rowspan="6"/>
                    <td class="final" bgcolor="#F6F0F6" rowspan="6"/>
                    <td class="final" bgcolor="#F6F0F6" rowspan="3">text</td>
                    <td class="final" bgcolor="#F6F0F6">text</td>
                    <td class="final" bgcolor="#F6F0F6">text</td>
                    <td class="final" bgcolor="#F6F0F6"/>
                </tr>
                <tr>
                    <td class="final" bgcolor="#F6F0F6">text</td>
                    <td class="final" bgcolor="#F6F0F6">text</td>
                    <td class="final" bgcolor="#F6F0F6"/>
                </tr>
                <tr>
                    <td class="final" bgcolor="#F6F0F6">text</td>
                    <td class="final" bgcolor="#F6F0F6">text</td>
                    <td class="final" bgcolor="#F6F0F6"/>
                </tr>
                <tr>
                    <td class="final" bgcolor="#DBDFDB" rowspan="3">text</td>
                    <td class="final" bgcolor="#DBDFDB">text</td>
                    <td class="final" bgcolor="#DBDFDB"/>
                    <td class="final" bgcolor="#DBDFDB">text</td>
                </tr>
                <tr>
                    <td class="final" bgcolor="#DBDFDB">text</td>
                    <td class="final" bgcolor="#DBDFDB"/>
                    <td class="final" bgcolor="#DBDFDB">text</td>
                </tr>
                <tr>
                    <td class="final" bgcolor="#DBDFDB">text</td>
                    <td class="final" bgcolor="#DBDFDB"/>
                    <td class="final" bgcolor="#DBDFDB">text</td>
                </tr>
            </table>
        </body>
    </html>
    

    I hope you could help me to solve this problem.



Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.