我目前正试图强制所有元素在 <th>
中在同一条线上,但这样做有问题。我看过很多帖子,常见的 css 答案似乎是使用 style="white-space:nowrap"
在 <th>
上元素。
<thead>
的代码如下:
<thead>
<tr>
<th><h5>Some</h5></th>
<th><h5>Thing</h5></th>
<th><h5>Another</h5></th>
<th><h5>Thing2</h5></th>
<th><h5>OneMore</h5></th>
<th style="white-space:nowrap">
<h5>Thing3</h5>
<md-button class="md-icon-button" style="bottom: 4px;margin-left:-3em">
<md-tooltip md-direction="auto" class="multiple-line-tooltip">
Some ToolTip Information Here
</md-tooltip>
<i class="material-icons md-dark">info</i>
</md-button>
</th>
</tr>
</thead>
我的问题是信息图标似乎总是显示在“Thing3”h5 元素下方。见下图:
感谢所有帮助。
最佳答案
h5 是 block 级元素 - 这是设计使然。
或许可以试试像 <b>
这样的内联元素相反,或者使用内联样式。
<h5 style="display:inline">
关于html - ASP.NET MVC 强制 <th> 元素在同一行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47023372/