i’m generating some simple html in a method and rendering
it into an html object on a form for reporting.
every so often, some rows in the table take up double the
height of the other rows; the html code for every row in
the table is exactly the same, but the rendered output
varies.
pasting the html into a text file and dropping it into a browser
gives the expected results (all rows are the same height).
this is making my report look bad, and my client unhappy.
here’s a sample of some html that’s causing the problem:
<html>
<head>
<style type="text/css">
.body { font-family: ArialMT; font-size: 9pt; color: #000000}
</style>
</head>
<body class="body">
<table class="body" border=0 width=100% cellpadding=0 cellspacing=0>
<tr><td><b>Options</b>:0/7</td></tr>
<tr><td height=10 width=80% bgcolor=#ffffff>&&2 Gable Vent 12 x 18</td><td align=right bgcolor=#ffffff>$142</td></tr>
<tr><td height=10 width=80% bgcolor=#dddddd>&&2 Snow Guards</td><td align=right bgcolor=#dddddd>$16</td></tr>
<tr><td height=10 width=80% bgcolor=#ffffff>&&2' Sidelights, 2 ft. at 6' to 8' purlin</td><td align=right bgcolor=#ffffff>$14</td></tr>
<tr><td height=10 width=80% bgcolor=#dddddd>&&1 S2-A Redwood pitch over 6/12 Cupola</td><td align=right bgcolor=#dddddd>$322</td></tr>
<tr><td height=10 width=80% bgcolor=#ffffff>&&2 x 8 Skirtboard</td><td align=right bgcolor=#ffffff>$96</td></tr>
<tr><td></td></tr>
<tr><td><b>Lean-To</b>:7/5</td></tr>
<tr><td height=10 width=80% bgcolor=#ffffff>&&<table border=0 width=100% cellpadding=0><tr><td width=1%></td><td>Dimensions: 8 x 8 x 8; Eave: Board and Batten White Pine, Color: Natural (unstained); Gable #1: (none), Color: ; Gable #2: (none), Color: ; Roofing: 3 tab 25 year shingles with 1/2" plywood, Color: ; 1 Pole(s) on 8 foot centers; 2 Pairs(s) of Dutch Corners</td></tr></table></td><td align=right bgcolor=#ffffff>$948</td></tr>
</table>
</html>
the HTML renderer in Java is very strict and might not accept code that other editors do.
stuff like height=10 (without quotes) can already mess up things.
height=“10” is the proper syntax.
I’m not saying that this is the actual reason of your problem.
Please post a screenshot of how your sample html should look like.
Maybe we can point you in right direction.
you’ll see some of the lines of the rendered html are twice the height
of others. if you open that same text file with a browser, all the lines
will be the same height.
btw: did you change your html code to proper syntax?
(height=“10” instead of height=10)
hmm, I just copy pasted the html code right into Servoy.
Could you try this as well and check the result?
Looks like the method application.readTXTFile(‘test.html’);
reads some extra breaks.
ok, i copied the text from my original message above,
went to a small test solution, put the field “description”
from the db example_data on a form. i then set the
display type to html_area.
switched to data mode, selected the text that was displaying
in the field, and pasted in the html text from the clipboard.
for some reason, the text just displays as text; servoy is
not rendering the html in this case. in other words, i see: