[英]How to use ol li and table side by side with no html validation error?
如何在沒有html驗證錯誤的情況下並排使用ol li和表? 我需要顯示此類數據。 我有大約一千行分頁數據。 如何整合?
在每行的第一個單元格上使用計數器CSS,然后設置樣式。 選擇器: tr :first-child
應該可以。
有關CSS COUNTER的更多信息: https : //developer.mozilla.org/en-US/docs/Web/Guide/CSS/Counters
GCyrillus是正確的:我創建了一個CSS計數器“ mycount”,然后每次我要打印時都使用class屬性。
這里的CSS代碼:
<style type="text/css">
body {
counter-reset: mycount; /* Set the counter to 0 */
}
.mycount:before{
counter-increment: mycount; /* Increment the counter */
content: counter(mycount) ". "; /* Display the counter */
}
</style>
和html表:
<table>
<tr>
<td><span class="mycount"></span></td>
<td>Snow Partridge</td>
<td>लरवान</td>
<td>Chinese Version</td>
</tr>
<tr>
<td><span class="mycount"></span></td>
<td>Tibetan Snowcock</td>
<td>कोङ्मा हिउकुखुरा</td>
<td>Chinese Version</td>
</tr>
</table>
<table cellspacing='0' cellpadding='0' border='0' class='table-list' style="width:100%;">
<tr>
<td valign="top" style="padding-right:20px;">
<ol>
<li>Snow Partridge</li>
<li>Tibetan Snowcock</li>
</ol>
</td>
<td valign="top" style="padding-right:20px;">
<ul>
<li>लरवान</li>
<li>कोङ्मा हिउकुखुरा</li>
</ul>
</td>
<td valign="top" style="padding-right:20px;">
<ul>
<li>Chinese Version</li>
<li>Chinese Version</li>
</ul>
</td>
</tr>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.