How can I force two elements to always stay on the same line in a

后端 未结 4 923
轮回少年
轮回少年 2021-02-02 06:42

The code is pretty simple:

相关标签:
4条回答
  • 2021-02-02 07:20

    You can use this: <tr valign="top"> This will make the vertical align at the top.

    0 讨论(0)
  • 2021-02-02 07:25

    Defining a white-space may be one of the way to get it done, but as a tabular data, its better if you fix the max size of width of the label instead

    label { width: 100px; display: inline-block; }
    
    0 讨论(0)
  • 2021-02-02 07:28

    This code works fine, and is responsive:

    table {
    width:100%;
    display: inline-block;
    }
    td, th {
    max-width:100%
    }
    
    0 讨论(0)
  • 2021-02-02 07:33

    You can force inline elements to stay on the same line using the CSS property white-space:

    <td style="white-space:nowrap;">
      this content will not be wrapped
    </td>
    
    0 讨论(0)
提交回复
热议问题