简体   繁体   English

如何在没有html验证错误的情况下并排使用ol li和表?

[英]How to use ol li and table side by side with no html validation error?

此图像将使您清楚我要如何显示这些数据。

How to use ol li and table side by side with no html validation error? 如何在没有html验证错误的情况下并排使用ol li和表? I need to show these kind of data. 我需要显示此类数据。 I have about thousand lines of data with pagination. 我有大约一千行分页数据。 How can i integrate it? 如何整合?

Use counter CSS on first cell of each row then you style. 在每行的第一个单元格上使用计数器CSS,然后设置样式。 Selector: tr :first-child should be okay . 选择器: tr :first-child应该可以。
more about CSS COUNTER: https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Counters 有关CSS COUNTER的更多信息: https : //developer.mozilla.org/en-US/docs/Web/Guide/CSS/Counters

GCyrillus is right: I create a CSS counter "mycount" and then I use a class attribute every time I want to print. GCyrillus是正确的:我创建了一个CSS计数器“ mycount”,然后每次我要打印时都使用class属性。
Here The CSS code: 这里的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>

And the html table: 和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.

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