ivica
ivica

Reputation: 1428

qtextbrowser align right or center

I was trying to make some kind of help system for my application. QTextBrowser and a static HTML file seemed perfect for me. Only thing is that QTextBrowser is not reading alignment correctly - everything is aligned left.

My HTML file is one big borderless table with some rows aligned center, others left or right. I could post the whole file, but there is no point, here is the code for one row with one cell; other cells are just copy/paste.

<tr align="center">
  <td><img src="10.png"></img></td>
</tr>

That image should be centered, but it's not. Whole page looks good in both Chromium and Firefox, only QTextBrowser is giving me trouble.

Upvotes: 1

Views: 1581

Answers (2)

ekhumoro
ekhumoro

Reputation: 120608

The QTextBrowser widget only has support for limited subset of html/css.

In this particular case, the tr tag has no support for the align attribute, but the td and th tags do (see the table cell attributes section for the complete list).

Upvotes: 1

Eric Hulser
Eric Hulser

Reputation: 4022

Try looking at it through a QWebView vs. a QTextBrowser. Not all HTML/CSS functionality exists in a QTextBrowser. If it looks right in Chrome, it'll probably look right in the WebKit.

Upvotes: 1

Related Questions