html - ASP.NET MVC 强制 <th> 元素在同一行

标签 html css angularjs asp.net-mvc

我目前正试图强制所有元素在 <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 元素下方。见下图:

enter image description here

感谢所有帮助。

最佳答案

h5 是 block 级元素 - 这是设计使然。

或许可以试试像 <b> 这样的内联元素相反,或者使用内联样式。

<h5 style="display:inline">

关于html - ASP.NET MVC 强制 <th> 元素在同一行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47023372/

相关文章:

html - 当表格单元格内的按钮获得焦点时隐藏表格单元格中的文本(按钮和文本)

javascript - 动态 Angular.js 菜单

javascript - UI-Grid 按内容设置列宽度

javascript - 仅在子菜单存在时显示图标

javascript - 如何使用PHP代码登录Linux服务器?

javascript - 文件浏览器 Accordion

php - 我如何修复 Moodle 2.3 中所有类(class)中心帖子中的 block

html, css img 停止收缩 <div> :)

css - D3 -- 无法通过 css 类设置文本颜色

javascript - 有没有办法在 AngularJS 中同时订阅多个事件?