html/table problems

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>

any help would be appreciated.
thanks.
rm.

Did you validate the html?

Can you post a screenshot what you’re expecting to see?
This screenshot is from Servoy.

Jan Blok:
Did you validate the html?

sorry, i’m not sure what you mean… :?

validate 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.

here’s a screenshot of what i get when i put that html into
an html object on a form in servoy:

you’ll see that the 2nd & 5th rows are double the height
of the other rows, even though the html is the same for
all of them.

here’s the same html pasted into a text file,
then opened in IE:

you’ll notice all the rows are the same height, as expected.

How is your HTMLcode being rendered?
label attached to a global/dataprovider?
global/dataprovider as html area?
filling text property of a label?

global as html area.

should that make a difference?

still waiting to hear from someone at servoy about this problem.

thanks.
rm.

Not able to add screenshot right know, but I can’t reproduce the error based on the sample code in this thread.
Will send you a mail.

btw: did you change your html code to proper syntax?
(height=“10” instead of height=10)

maarten:
…but I can’t reproduce the error based on the sample code in this thread.

that’s odd; here are steps that seem to reproduce the problem:

copy the text from my original message (see above)

paste the text into a text file (‘test.html’), and save
in the servoy directory.

create a global in a solution; call it “test”

drop this global on a form. set the display type to html_area

create a method with the following line of code:

globals.test = application.readTXTFile('test.html');

switch to data mode and execute the method.

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)

yes.

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.

hi maarten;

i’m not sure what you mean by “pasted the html code
right into servoy”.

could you elaborate? :?

Ctrl+C the code form this thread
Ctrl+V into a Servoy field

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:

...etc.

after doing the paste.

  1. make sure the field length is large enough for the htmlcode (varchar = …)
  2. duplicate the field and change that into textarea.
  3. paste the code inside the text area.
  4. see how the html-area changes

i found it;

it turns out that the lines that are double height are
lines where the dollar amount is 3 digits+the dollar
sign.

by adding “width=10%” to the dollar amount
statements, the field is forced to be wider, and the
problem goes away.

thanks so much for helping me find this!

rm.