Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QWebView - Pb to display HTML table with rowspan with QT5.5
Forum Update on Monday, May 27th 2025

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

Scheduled Pinned Locked Moved Unsolved General and Desktop
htmlqwebviewqt5.5csstable
1 Posts 1 Posters 1.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Morgar
    wrote on 1 Mar 2016, 07:55 last edited by
    #1

    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.

    1 Reply Last reply
    0

    1/1

    1 Mar 2016, 07:55

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved