HTML styles in the LocalInspection tooltips

Answered

Hi all, I have following html code in the html tooltip

 

<html>

<body>

<table style="border-collapse: collapse; width: 100%;" border="1">
<tbody>
<tr>
<td style="width: 100%;"><span style="font-size: 18pt;"><span style="font-family: Arial;"><span style="color: #000000;"><strong>ruleIdShortDescriptionText</strong></span></span></span><img src="https://img.icons8.com/?size=2x&amp;id=G_CJ8xWqKGEC&amp;format=png" alt="" style="float: right;" width="60" height="60" /></td>
</tr>
<tr>
<td style="width: 100%;"><span style="font-size: 16pt;"><span style="font-family: Arial;"><span style="color: #000000;">messageText</span></span></span></td>
</tr>
<tr>
<td style="width: 100%;">ruleIDText</td>
</tr>
</tbody>
</table>
</body>
</html>

And on the website picture align is right, but on intellij align isn't working and picture placed right near the text.
Is it possible to solve it on some way?

0
1 comment

Hi,

Inspection tooltip content is rendered with javax.swing.JEditorPane. Do not expect exactly the same results as in modern browsers.

What is the reason for so complex HTML formatting of inspection messages? They should be simple, see: https://jetbrains.design/intellij/text/inspections/

Applying so complex formatting and layout will make your plugin inconsistent with other IDE plugins and features, which will result in bad UX. See: https://plugins.jetbrains.com/docs/intellij/plugin-user-experience.html#consistent-and-good-looking-ui

0

Please sign in to leave a comment.