我正在使用renderSnake在Java中生成一个html报告。我对renderSnake还很陌生,所以我仍然对一些基础知识心存疑虑。我的报告包含一个对象列表,其大小可能有所不同。
我希望这些对象中的每一个都能生成相同的html代码,但我不知道如何迭代地修改或向HtmlCanvas添加内容。
我在想象这样的事情:
HtmlCanvas html = new HtmlCanvas();
html
.head()
some code here
._head()
.body()
some code here
._body
._html();
for(oject e : inList){
generatedCode=generate some html code
html.add(generatedCode)
}
有人知道如何做到这一点吗?
我自己得到了一个解决方案。
只需要重新打开htmlcanvas,它就会将它们连接起来,而不是覆盖它。
html
.html()
.body()
... some code here
._body()
._html();
some code
for(object e:inlist){
html
.html()
.body()
... some more code here
._body()
._html();
}