html - 我怎样才能编写 CSS 来使表格看起来像?

标签 html css

我想像下面这样制作标签列表。
我想使用 CSS 而不是使用 Table 标签。
我该怎么做?

Tags: Apple Banana Melon Strawberry Kiwi Orange 
      Pineapple Carrot Onion Tomato Bacon Sandwitch
      SoyBeans Pork Beef Chicken 

最佳答案

使用display:table-cell

HTML

<div class="table">
  <div class="td">tags</div>
  <div class="td">Apple Banana Melon Strawberry Kiwi Orange Pineapple Carrot Onion Tomato Bacon Sandwitch SoyBeans Pork Beef Chicken </div>
</div>

CSS

.table{display:table-row; width:350px; }
.td:first-child{width:10px; }
.td{display:table-cell;  padding:10px; width:320px}

LIVE DEMO

关于html - 我怎样才能编写 CSS 来使表格看起来像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14232167/

相关文章:

javascript - 在屏幕宽度 860px 下隐藏文本

html - JSON - 从 YouTube 播放列表中获取超过 25 个视频

html - 部署我的应用程序时,CallComposite azure 样式不起作用

JavaScript 模板“不给糖就捣蛋”?

javascript - 如何去掉url中的id

HTML CSS : Carousel Slide Show- Add Title Header

html - Bootstrap - 自定义闪光灯/警报框

html - 背景图像上的 CSS3 过渡

css - wordpress 删除主页图标 woocommerce Artificer 菜单

php - 我如何编写用于自动变色的 php 代码?