简体   繁体   English

表格的 Flex 方向

[英]Flex-direction for tables

Here is what I'm intending to do: Table这是我打算做的:

Current HTML + CSS, for some reason the table can't contain multiple objects in a row.:当前的 HTML + CSS,出于某种原因,该表不能在一行中包含多个对象。:

 .boardTitle{ margin-top: 10px; text-align: center; font-size: 20px; color: red; } .boardTable{ flex: 1; flex-direction: column; } .boardRow{ flex-direction: row; } .thread{ border: solid; }
 <div> <div class="boardTitle"> Name </div> <div class="boardTable"> <div class="boardRow"> <div class="thread"> 1 </div> <div class="thread"> 2 </div> </div> </div> </div>

.boardRow class is contain the threads so you should give it display: flex if you want them to be next each other. .boardRow 类包含线程,因此您应该给它 display: flex 如果您希望它们彼此相邻。

.boardRow{
      display:flex;
      flex-direction: row;
    }

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

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