datatables简单使用实例

---------------------------------------------------------------------------
struts2.xml
---------------------------------------------------------------------------
<action name="testTable" method="testTable" class="topoAction">
    <result name="success">/analysis/alarm/testTable.jsp</result>
</action>

---------------------------------------------------------------------------   
topoAction.java
---------------------------------------------------------------------------
List<Test>  recordList = new ArrayList<Test>();
get/set方法
public String testTable(){
recordList = ...;
return "success";
}

---------------------------------------------------------------------------       
testTable.jsp
---------------------------------------------------------------------------

dtable1=$( '#example').dataTable();


<table   width="100%" height=""   id="example" class="display" cellpadding="0" cellspacing= "0" border ="0">
    <thead style="background-color:#5f7180">
    <tr >
    <th >编码</ th>
    <th >型号</ th>
    <th >姓名</ th>
    </tr >
    </thead >
    <tbody >
    <c:if test="${! empty recordList}" >
    <c:forEach var = "recordData" items = "${recordList}" >
    <tr >
    <td >${recordData.maschineCode }</td>
    <td >${recordData.maschineModel }</ td>
    <td >${recordData.welderName }</ td>
    </tr >
    </c:forEach >
    </c:if >
    </tbody >
    </table >
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值