如何防止 display: grid 自动拉伸子表行

huangapple go评论52阅读模式
英文:

How to prevent display: grid from auto-stretching children table rows

问题

我有一个名为"passives_div"的主容器(div)。
在这个div中有3个表格。
如果其中一个表格的行数少于其任何兄弟表格的行数,那些表格行会拉伸,我需要知道如何停止拉伸。

这是正在发生的情况的屏幕截图。屏幕截图显示了3个事物...结果显示,受影响的HTML和使用的CSS。

英文:

I have a main (container) div called "passives_div".
I have 3 tables inside this div.
If one of the tables has fewer rows than any of it's sibling tables, those table rows stretch, and I need to know of a way to stop stretching.

Here is a screenshot of what's happening. The screenshot shows the 3 things.. the resulting display, the affected HTML, and the CSS used.

如何防止 display: grid 自动拉伸子表行

答案1

得分: 1

尝试在.passivesDiv上使用align-items: start。<br>
希望这能帮助。

英文:

Try align-items: start on .passivesDiv.<br>
Hope that helps.

答案2

得分: 0

请尝试使用固定的表格行高。

英文:

Please try with fixed hight of row of table

huangapple
  • 本文由 发表于 2023年2月24日 04:10:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/75549843.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定