mayaa-complex-table


<?xml version="1.0" encoding="UTF-8"?>
<m:mayaa xmlns:m="http://mayaa.seasar.org"
xmlns:s="http://sastruts.seasar.org"
xmlns:f="http://sastruts.seasar.org/functions"
xmlns:bean="http://jakarta.apache.org/struts/tags-bean"
xmlns:html="http://jakarta.apache.org/struts/tags-html"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:fmt="http://java.sun.com/jstl/fmt"
xmlns:fn="http://java.sun.com/jsp/jstl/functions">
<m:beforeRender><![CDATA[
var idxs = [2,1,4,2,3,6,1];
var buf = [];
for (var i in idxs){
for (var j = 0; j < idxs[i]; j++){
if (j == 0 && idxs[i] == 1){
buf.push('<tr>');
buf.push('<td>NoNoNo</td>');
buf.push('<td>NaNaNa</td>');
buf.push('<td>girl</td>');
buf.push('<td>Jiangxi</td>');
buf.push('<td>列</td>');
buf.push('</tr>');
j = idxs[i] + 2;
} else if (j == 0 && idxs[i] > 1){
buf.push('<tr>');
buf.push('<td>列</td>');
buf.push('<td rowspan=' + idxs[i] + '>跨行</td>');
buf.push('<td>列</td>');
buf.push('<td rowspan=' + idxs[i] + '>跨行</td>');
buf.push('<td>列</td>');
buf.push('</tr>');
} else{
buf.push('<td>列fuck</td>');
buf.push('<td>列fuck</td>');
buf.push('<td>列</td>');
buf.push('</tr>');
}
}
}
var content = buf.join();
]]></m:beforeRender>
<m:for m:id="loop"
init="${var idx = 0}"
test="${idx < 10}" after="${idx++}" max="-1" >
${content}
</m:for>
</m:mayaa>


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Create by dolphin</title>
</head>
<body>
<table border="1">
<tr id="header">
<th>name</th>
<th>sex</th>
<th>age</th>
<th>school</th>
<th>myname</th>
</tr>
<span id="loop">
<tr id="content">
<td>Dummy content1</td>
<td>Dummy content2</td>
<td>Dummy content3</td>
</tr>
</span>
</table>
</body>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值