前端数据的展示遇到应table展示时

来源:互联网 发布:雅诗兰黛眼霜 知乎 编辑:程序博客网 时间:2024/06/10 13:48

方法一:把显示的值写到<td>标签之间。

<div class="jf_con present_con">
<table cellspacing="0" class="js-zjls-table">
<tbody>
<tr class="jf_table_top">
<td width="12.35%">奖品名称</td>
<td width="14.66%">奖品图片</td>
<td width="20.5%">奖品描述</td>
<td width="13.45">中奖时间</td>
<td width="20.5%">活动名称</td>
<td width="8.8%">领奖状态</td>
<td width="8.8%">操作</td>
</tr>
 
<c:forEach var="prizeReturnInfo"
items="${prizeRturnInfoDtoList}" varStatus="status">
  <tr>
                                 <td>${prizeReturnInfo.prizeName} </td>
                                    <td><img src="${prizeReturnInfo.prizePic}"style="width:133px; height:139px;"></td>
                                    <td class="padding-20">${prizeReturnInfo.prizeDis}</td>
                                    <td>${prizeReturnInfo.prizeTime}</td>
                                    <td class="padding-20">${prizeReturnInfo.activityName}</td>
                                    <td>${prizeReturnInfo.acceptState}</td>
                                    <td class="border-r-no">
                                    <c:if test="${prizeReturnInfo.acceptState eq '未领奖'}"><a href='javascript:;' onclick='receiveReward(${prizeReturnInfo.lotteryId},${prizeReturnInfo.giftFlag})' class='receiveReward'>领奖</a></c:if>
                                    <c:if test="${prizeReturnInfo.acceptState eq '已领奖'}"><a href='javascript:;' >---</a></c:if>
                                    <c:if test="${prizeReturnInfo.acceptState eq '已过期'}"><a href='javascript:;' >---</a></c:if> 
                                    </td>
                                </tr>    
</c:forEach>
</tbody>


</table>
</div>





方法2:   利用<c:out>标签。

 <table>
                            <tbody>
                                <tr class="titile">
                                    <td class="bx_name1 car_num_info"> 姓名</td>
                                    <td class="bx_name2">性别</td>
                                    <td class="bx_name3">证件类型</td>
                                    <td class="bx_name4">证件号</td>
                                    <td class="bx_name5">出生日期</td>
                                    <td class="bx_name6">手机号</td>
                                    <td class="bx_name7">电子邮箱</td>                               
                                    <td class="bx_name8 car_num5_info">操作</td>
                                </tr>
                                <c:forEach items="${insuredList }" var="insuredval"
varStatus="num">
                                <tr class="titile_info">
                                <td style="display: none;"
title="<c:out value="${insuredval.sid }" />" id="insuredSid"><c:out
value="${insuredval.sid}" />&nbsp;</td>
                                    <td class="bx_name1 car_num_info" title="<c:out value="${insuredval.insuredname}" />">
                                    <c:choose>
<c:when test="${fn:length(insuredval.insuredname)>4}">
<c:out
value="${fn:substring(insuredval.insuredname,0,4)}..." />
</c:when>
<c:otherwise>
${insuredval.insuredname}
</c:otherwise>
</c:choose></td>
                                    <td class="bx_name2" id="${insuredval.insuredsex}"><c:choose>
<c:when test="${insuredval.insuredsex eq '1'}">

</c:when>
<c:when test="${insuredval.insuredsex eq '2' ||insuredval.insuredsex eq '0' }">

</c:when>
<c:otherwise>
</c:otherwise>
</c:choose></td>
                                    <td class="bx_name3" id='${insuredval.identitytype}'><c:if
test="${insuredval.identitytype eq '01'}">身份证</c:if> <c:if
test="${insuredval.identitytype eq '02'}">户口簿</c:if> <c:if
test="${insuredval.identitytype eq '03'}">护照</c:if> <c:if
test="${insuredval.identitytype eq '04'}">军人证件</c:if> <c:if
test="${insuredval.identitytype eq '10'}">往来港澳通行证</c:if> <c:if
test="${insuredval.identitytype eq '09'}">大陆居民往来台湾通行证</c:if>
<c:if test="${insuredval.identitytype eq '25'}">港澳居民来往内地通行证</c:if>
<c:if test="${insuredval.identitytype eq '26'}">台湾居民往来内地通行证</c:if>
<c:if test="${insuredval.identitytype eq '07'}">港澳居民身份证</c:if>
<c:if test="${insuredval.identitytype eq '99'}">其他</c:if>
<c:if test="${insuredval.identitytype eq '16'}">外国人永久居留身份证</c:if>
<c:if test="${insuredval.identitytype eq '06'}"></c:if>
</td>
                                    <td class="bx_name4" title="<c:out value="${insuredval.identitynumber}" />"><c:choose>
<c:when test="${fn:length(insuredval.identitynumber)>18 }">
<c:out
value="${fn:substring(insuredval.identitynumber,0,18)}" />
</c:when>
<c:when test="${insuredval.identitytype eq '06'}">


</c:when>
<c:otherwise>
${insuredval.identitynumber}
</c:otherwise>
</c:choose> &nbsp;</td>
                                    <td class="bx_name5" title="<fmt:formatDate value="${insuredval.insuredbirthday}" pattern="yyyy/MM/dd"/>"><fmt:formatDate value="${insuredval.insuredbirthday}"
pattern="yyyy/MM/dd" /></td>
                                    <td class="bx_name6" title="<c:out value="${insuredval.insuredmobile}" />"><c:out
value="${insuredval.insuredmobile}" /></td>
                                    <td class="bx_name7" title="<c:out value="${insuredval.insuredemail}" />"><c:choose>
<c:when test="${fn:length(insuredval.insuredemail)>6}">
<c:out
value="${fn:substring(insuredval.insuredemail,0,6)}..." />
</c:when>
<c:otherwise>
${insuredval.insuredemail}
</c:otherwise>
</c:choose></td> 
<td style="display: none;"
title="<c:out value="${insuredval.flag}" />" id=""><c:out
value="${insuredval.flag}" /></td>
                                    <td class="bx_name8 car_num5_info"><a href="#" style="margin-left: 0;" onclick="changeDefaultTo(this);return false;">
                                    <c:choose>
                                    <c:when test="${insuredval.flag==1}">&nbsp;取消默认</c:when>
<c:otherwise>&nbsp;设为默认</c:otherwise>
</c:choose></a>
                                    <a href="#" class="xiugai_username" onclick="modifyPersonNew(this);">修改</a>
                                    <a href="#" style="margin-left: 0;" onclick="doDelete(this);return false;"> | 删除</a></td>
                                </tr>
                                </c:forEach>
                            </tbody>
                        </table>d