【问题标题】:Having trouble aligning checkboxes in an HTML table在 HTML 表格中对齐复选框时遇到问题
【发布时间】:2016-04-21 19:53:04
【问题描述】:

我的table 的第一列中的checkboxes 无法在右侧对齐。

<form>
   <div>    
        <table>
            <th>Trail</th>
            <th>Year</th>
            <th>Mileage</th>
            <th>Direction</th>
            <tr>
                <td>
                    <label for="AT">AT</label>
                    <input type="checkbox" id="AT" name="AT"  value="Yes">
                </td>

我正在使用CSS 代码:

input [type=checkbox] {
    text-align: right;
}

【问题讨论】:

  • 我的答案应该可以解决。

标签: html css html-table text-align


【解决方案1】:

试试这个怎么样

<table>
    <th>Trail</th>
    <th>Year</th>
    <th>Mileage</th>
    <th>Direction</th>
    <tr>
        <td>
            <input type="checkbox" id="AT" name="AT"  value="Yes"/>
            <label for="AT">AT</label>
        </td>

这里是jsfidlle

【讨论】:

  • 如此简单。我想多了。首先使用复选框看起来更好。谢谢。
猜你喜欢
  • 2017-10-12
  • 2021-02-19
  • 2021-04-12
  • 1970-01-01
  • 2012-12-18
  • 2021-12-18
  • 1970-01-01
  • 1970-01-01
  • 2014-08-24
相关资源
最近更新 更多