可以根据数组内容循环插入form表单的列()吗?

吾身为剑所成 2017-12-01 11:38:14


<#if pcCode == 'TENPAY'>
<tr >
<th class="selField desField goMiddle" colspan="1" nowrap="nowrap">

</th>
<th class="selField desField goMiddle" colspan="2" nowrap="nowrap" >
财付通B2B/B2C
</th>
<th class="selField desField goMiddle" colspan="3" nowrap="nowrap" >
财付通B2G微信
</th>
<th class="selField desField goMiddle" nowrap="nowrap" colspan="1" >
勾兑备注
</th>
</tr>
<#list resultList as crLog>
<tr>
<td style="text-align:center;" class="dataTd" nowrap="nowrap">
${crLog[0]!""}
</td>

<td style="text-align:center;" class="dataTd" nowrap="nowrap">
${crLog[1]!""}
</td>
<td style="text-align:center;" class="dataTd" nowrap="nowrap">
${crLog[2]!""}
</td>

<td style="text-align:center;" class="dataTd" nowrap="nowrap">
${crLog[3]!""}
</td>
<td style="text-align:center;" class="dataTd" nowrap="nowrap">
${crLog[4]!""}
</td>
<td style="text-align:center;" class="dataTd" nowrap="nowrap">
${crLog[5]!""}
</td>

<td style="text-align:center;" class="dataTd" nowrap="nowrap">
${crLog[6]!""}
</td>
</tr>
</#list>
</#if>



最近在写一个支付渠道汇总信息的页面,因为渠道太多,而且不同渠道的显示内容不同,所以想问问有没有什么方法,可以根据上面代码里的crLog[ ]数组,循环添加表单的列,就是下面这个

<td style="text-align:center;" class="dataTd" nowrap="nowrap">
${crLog[i]!""}
</td>


有看到一些js的写法,但是和我这个不太搭,上面这个只是“TENPAY”一个的样式,还有好多“ICBC”、“CCB”、"ALIPAY"、"TEEPAY"............好多渠道,各不相同,一两个针对form的js根本解决不了。

我在后台已经将不同渠道的数据处理好了放在不同规格的数组里了,但是页面这边我现在只能用这种写死的蠢办法,一个页面大几千行,都是重复的代码............不是前端,强行要写前端的东西头好大...................

效果是这样(为了节省版面,上面删了部分代码)........求解




...全文
208 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

61,112

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧