0

我正在尝试使用 freemarker 生成一个表。

<table class="timeline">
        <tr>
            <#list children as child >
                <td class="timeline-item"><a href="${child.url}">${child.title}</a></td>
                <td><img class="sitelink_arrow" src="images/arrow.png"/></td>
            </#list>
        </tr>
    </table>

这将产生一个错误:

期待以下之一: ... ... ... ... ... ... ... ... <_INCLUDE> ...
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
... ... . ... ... ... ... ... ... ... ... ... ... ... "${" ...
"#{" ...

如果我将此列表放在表格之外,那么它就可以正常工作。有任何想法吗 ?

4

1 回答 1

1

您的代码应如下所示:

如果您也发布代码会更好。也完全错误。

[#ftl]
<table id="timelineTable" class="timeline" align="left" width="100%">
    [#if children?? && children?size > 0] 
    [#list children as child]
    <tr>
        <td class="timeline-item">
            <a href="${child.url}">${child.title}</a>
        </td>
        <td>
            <img class="sitelink_arrow" src="images/arrow.png"/>
        </td>
    </tr>
    [/#list]
[#else] 
    No Details Available
[/#if]      

于 2012-09-01T06:36:44.077 回答