簡體   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