Hi! First of all - sorry for my English, I'm trying to do my best.

I want to make the report (and print it) with quite complex table. Last row of my table must be painted in part, i.e. part of cells shouldn't be painted. Something like that:

qqq.JPG

In HTML terms it looks like that (very garbage code, just explain my idea):

Qt Code:
  1. <table cellspacing=0 style="border-collapse: collapse">
  2. <tr><td style='border: 1px solid black'>1</td>
  3. <td style='border: 1px solid black'>2</td>
  4. <td style='border: 1px solid black'>3</td></tr>
  5. <tr><td style='border: 1px solid black'>One</td>
  6. <td style='border: 1px solid black'>Two</td>
  7. <td style='border: 1px solid black'>Three</td></tr>
  8. <tr><td style='border-width: 1 0 0; border-style: solid; border-color: black'></td>
  9. <td style='border-width: 1 0 0; border-style: solid; border-color: black'></td>
  10. <td style='border: 1px solid black'>Finish</td></tr>
  11. </table>
To copy to clipboard, switch view to plain text mode 

I'm using QTextDocument for my task. But neither setHtml() or QTextCursor (rather QTextTable) doesn't support styles for particular tables, only for the whole table! My attemps (using html, QTextCursor gives about the same result):
1) if set border style to the whole table, we get proper borders (a bit of thick, but that's other question):
Qt Code:
  1. QString html = "<html><body>";
  2. html += "<table cellspacing=0 cellpadding = 2 style='border-width: 1px; border-style: solid; border-color: #000000'>";
  3. html += "<tr>";
  4. html += "<td>1</td>";
  5. html += "<td>2</td>";
  6. html += "<td>3</td>";
  7. html += "</tr>";
  8. html += "<tr>";
  9. html += "<td>One</td>";
  10. html += "<td>Two</td>";
  11. html += "<td>Three</td>";
  12. html += "</tr>";
  13. html += "<tr>";
  14. html += "<td></td>";
  15. html += "<td></td>";
  16. html += "<td>Finish</td>";
  17. html += "</tr>";
  18. html += "</table></body></html>";
  19.  
  20. page->setHtml(html);
To copy to clipboard, switch view to plain text mode 
qq1.JPG

2) If try to make the same as with HTML (i.e. set border style for every cell), we get no borders at all.
Qt Code:
  1. QString html = "<html><body>";
  2. html += "<table cellspacing=0 cellpadding=2'>";
  3. html += "<tr>";
  4. html += "<td style='border-width: 1px; border-style: solid; border-color: #000000'>1</td>";
  5. html += "<td style='border-width: 1px; border-style: solid; border-color: #000000'>2</td>";
  6. html += "<td style='border-width: 1px; border-style: solid; border-color: #000000'>3</td>";
  7. html += "</tr>";
  8. html += "<tr>";
  9. html += "<td style='border-width: 1px; border-style: solid; border-color: #000000'>One</td>";
  10. html += "<td style='border-width: 1px; border-style: solid; border-color: #000000'>Two</td>";
  11. html += "<td style='border-width: 1px; border-style: solid; border-color: #000000'>Three</td>";
  12. html += "</tr>";
  13. html += "<tr>";
  14. html += "<td style='border-style: none;'></td>";
  15. html += "<td style='border-style: none;'></td>";
  16. html += "<td style='border-width: 1px; border-style: solid; border-color: #000000'>Finish</td>";
  17. html += "</tr>";
  18. html += "</table></body></html>";
  19.  
  20. page->setHtml(html);
To copy to clipboard, switch view to plain text mode 
qq2.JPG

But I need the table at the beginning of my post. Any suggestions? Only crazy option comes to mint: stupidly draw each line with QPainter...