views:

37

answers:

2

Is there a way to set a fix size for the characters in HTML? That means, say …

First row, 8th character is “Z” Second row’s 8th character is “A”

I want to print out , when printed the “Z” has to be exactly on top of “A”

*Note: I'm using the insertHtml method in QTextEdit()

A: 

Put the text in <tt> tags (or <pre> around a whole paragraph of text).

James Hopkin
+1  A: 

What you're asking for is called a fixed-width font. As James Hopkin remarked, HTML text in <tt> or <pre> tags is rendered with a fixed-width font.

However, what you describe sounds like a table. HTML has direct support for that, with <table>, <tr> (row) and <td> (data/cell). Don't bother with fixed-width fonts; just put your A and the Z in the second <td> of their rows.

MSalters
thx :)although it looks a bit .... kinda wierd with the table td method, it does solve the issue :)thx again.
lionel319