繁体   English   中英

如何造型 <td> 里面的物品 <table> 标签?

[英]How to style <td> items inside <table> tag?

我正在使用带有css的jsp来设置<table>标签内<table> <td>样式。 我想要如下代码:

在此处输入图片说明

但是现在我得到:

在此处输入图片说明

 #bengalistorycontainer{ width:100%; } table.my-special-table { width: 10px; height: 10px; border: 1px rgb(89,89,89) solid; } 
 <table class="my-special-table"> <tr> <c:forEach begin="1" end="${classfile}" var="i"varStatus="loop"> <c:choose> <c:when test="${classfile eq i}"> <td>${1} </div></td> </c:when> <c:otherwise> <td><a href="#">${2}</a></td> </c:otherwise> </c:choose> </c:forEach> <c:if test="${totalpagenumber != 1}"> <td> <a href="#">next</a> </td> </c:if> 

jsfiddle

我究竟做错了什么?

只需将代码编辑为以下内容:

 #bengalistorycontainer{ width:100%; } table.my-special-table td{ width: 10px; height: 10px; border: 1px rgb(89,89,89) solid; } 
 <table class="my-special-table"> <tr> <c:forEach begin="1" end="${classfile}" var="i"varStatus="loop"> <c:choose> <c:when test="${classfile eq i}"> <td>${1} </div></td> </c:when> <c:otherwise> <td><a href="#">${2}</a></td> </c:otherwise> </c:choose> </c:forEach> <c:if test="${totalpagenumber != 1}"> <td> <a href="#">next</a> </td> </c:if> 

您确实选择了表格,而不是td元素.. :)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM