将表格转换为具有特定宽度的div
我想制作一个类似于 ESPN 大学橄榄球排名的排名表。如何将这段代码转换为具有特定宽度的 div 和 lis ?我确实查看了源代码,这段代码使用了一个表,其中包含偶数行和奇数行的类。我是
我正在考虑类似的事情,但我不知道如何为不同组件设置特定宽度(排名分数等)
<div id="topRanked">
<span id="title">Top Ranking</span>
<div id="headers">
</div>
<ul id="topTen">
<li class="odd"></li>
<li class="even"></li>
</ul>
</div>
I want to make a table for rankings that looks like this ESPN college football ranking. How would you turn this code into divs and lis with specific widths? I did view source and this code uses a table with classes for even and odd rows. I was
I was thinking of something along the lines of this, but I don't know how to set specific widths for the different components (rank score etc)
<div id="topRanked">
<span id="title">Top Ranking</span>
<div id="headers">
</div>
<ul id="topTen">
<li class="odd"></li>
<li class="even"></li>
</ul>
</div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
老实说,我同意表格数据最好在表格中提供的评论。
但是,如果您想在列表元素中使用 div,那么对 div 使用 display:inline-block 和 Overflow:none 应该使它们保持垂直对齐和固定宽度。
display:inline-block 得到很好的支持
标记和样式如下:
... 应该给出你一个开始。
To be honest I would agree with the comments that tabular data is better served in a table.
But if you want to use div's within list elements, then using display:inline-block and overflow:none for the divs should keep them vertically aligned and fixed width.
display:inline-block is well supported
Markup and style like:
... should give you a start.