List
List<String> clientSourceData=new ArrayList<String>();clientSourceData.add("field字段");clientSourceData.add("title标题");
ftl:
<#if clientSourceData?exists><#list clientSourceData as key> <tr><td>${key}</td></tr></#list></#if>
Map
Map<String,String> clientSourceData=new HashMap<String,String>();clientSourceData.put("field", "字段");clientSourceData.put("title", "标题");
ftl:
<#if clientSourceData?exists><#list clientSourceData?keys as key> <tr><td>${key}</td><td>${clientSourceData[key]}</td></tr></#list></#if>
List<Map>
List<Map<String,String>> columns=new ArrayList<Map<String,String>>();for(int i=0;i<10;i++){Map<String,String> col=new HashMap<>();col.put("field", "字段"+i);col.put("title", "标题"+i);columns.add(col);}
ftl:
<#list columns as col>{field : ${col["field"]},halign:'center',title : ${col["title"]},}
</#list>