如何在td中用标签类包装span(How to wrap span with label class in td)
我需要在一个范围内显示一个项目列表,其中包含类“label”:
<td> <span class="label label-default">My Item 1223</span> <span class="label label-default">My Item 2378</span> .... <span class="label label-default">My Item 898389 </span> </td>我的问题是那些跨度不包裹在我的表中。 如下所示:
我不知道怎样继续把它包裹在我的<td> 。
如果您对如何进行有任何建议......
I need to show a list of item in span with class "label" inside a :
<td> <span class="label label-default">My Item 1223</span> <span class="label label-default">My Item 2378</span> .... <span class="label label-default">My Item 898389 </span> </td>My issue is that those span don't wrap in my table. As you can see below:
I don't know how to proceed to make it wrap in my <td>.
If you have any advice about how to proceed...
最满意答案
将最大宽度设置为您的td。
td { max-width:230px; }同时将标签浮动到左侧并将显示更改为display:block;
.label{ display:block; float:left; }看我的演示
Set a max-width to your td.
td { max-width:230px; }Also float your label to the left and change your display to display:block;
.label{ display:block; float:left; }See my demo
更多推荐
发布评论