I noticed this too, when I was new to AVFP.
1) I think you may find the problem in htmltable() function itself. I see a lot of string comparisons of 'less than' and 'greater than' ( i.e. < and > ) using their HTML escape character equivalents.
E.g.lnAtPos1 = ATC('& lt;'+ALLTRIM(lcTableTag)+'& gt;', lcHTMLstr)
However, I did not find any of these characters in the table template html file under processing.
Therefore, the above line, I guess should have been
lnAtPos1 = ATC('<'+ALLTRIM(lcTableTag)+'>', lcHTMLstr)
I find number of such commands in htmlTable() function. All these may need to be fixed.
2) Once these are fixed, we can call the table template defined in tabletest.avfp into the testhtmltable.avfp as follows
CREATE CURSOR tcursor (cid C(10), military I)
INSERT INTO tcursor (cid, military) VALUES (SYS(2015), 1)
INSERT INTO tcursor (cid, military) VALUES (SYS(2015), 2)
INSERT INTO tcursor (cid, military) VALUES (SYS(2015), 3)
lcHTMLfile = 'tabletest'+oProp.Ext
lcHTMLout= oHTML.htmlTable('apptment',lcHTMLout,50,0,'#E5E5E5',.F.,1,'') && note 5 is switched to 1.
The lcHTMLout can then be embedded in the <Body> section to display the table without the table header
3) I still see some problems. I see three extra characters in the lcHTMLout string ( these are at the end of the string). but the table does show properly.
I don't have time for a more detailed analysis of the trace but I hope this can give a good starting point, if you plan on fixing it in future.
One more point.
After lcHTMLout= FILETOSTR(oProp.HtmlPath+lcHTMLfile) the value of lcHTMLout is shown as follows:
ï»¿<div class="block"> <apptment> <table border="0" class="time_data"> <tr> <td width="70"><%=tCursor.cid%></td> <td width="70"><%=tCursor.military%></td>
</tr> </table> </apptment> </div>
Notice the three characters at the start of this string?. Could be the reason for the above problem.