简体   繁体   English

在列之后的 html 表中强制换行

[英]force line break in a html table after of columns

I want to have just 4 columns per row in my table , how can i force a line break in table using css ?我想在我的tablerow只有 4 列,如何使用css在表格中强制换行? please check what i'v tried in the link below -请检查我在下面的链接中尝试过的内容 -

<table style="table-layout: fixed; width: 100%;">
    <tbody>
        <tr>
            <td style="word-wrap: break-word;overflow-wrap: break-word;width:25%"></td>
            <td style="word-wrap: break-word;overflow-wrap: break-word;width:25%"></td>
            <td style="word-wrap: break-word;overflow-wrap: break-word;width:25%"></td>
            <td style="word-wrap: break-word;overflow-wrap: break-word;width:25%"></td>
            <td style="word-wrap: break-word;overflow-wrap: break-word;width:25%"></td>
        <tr>
    </tbody>
</table>

LINK - jsfiddle链接 - jsfiddle

I found an easy way to do it using Bootstrap :我找到了一种使用 Bootstrap 的简单方法:

<div class="row">
    <div class="col-sm-3" style="background-color:lavender;"><table>...</table></div>
    <div class="col-sm-3" style="background-color:lavenderblush;"><table>...</table></div>
    <div class="col-sm-3" style="background-color:lavender;"><table>...</table></div>
    <div class="col-sm-3" style="background-color:lavenderblush;"><table>...</table></div>
</div>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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