html - 将行平均分为 3 列

标签 html css html-table angular-material2

我正在使用 mattable,假设我有 26 条记录,那么我需要在 Column1 中显示前 10 条记录,在第 2 列中显示接下来的 10 条记录,在第 3 列中显示接下来的 6 条记录。他们有什么方法可以用 CSS 实现吗?

最佳答案

使用显示 flex

html

<div class="main-row">
   <div class="col">
   </div>
    <div class="col">
   </div>
    <div class="col">
   </div>
</div>

CSS

.main-row{
  display:flex;
}

.col{
  flex-grow:1;
  height:150px;
  background-color:#e5e5e5;
  margin:0px 2px;
}

关于html - 将行平均分为 3 列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53128055/

相关文章:

javascript - 如何使 <td> 今天的日期 + 14

javascript - 在 Firefox 中拖动元素时出现问题

html - 输入不可点击

php - 如何在 CSS 文件中使用 PHP 代码

html - 如何使列(包含带空格的文本)的宽度适合 HTML 表格中的内容?

html - 当内容对于其大小来说太大时,在 HTML 表格内容中显示 "..."

javascript - 所选 event.target 的父 div 的边框轮廓

html - Bootstrap - 定制卡片

css - 滚动不适用于动态表

html - 跨度 :after 中的 FontAwesome