编辑表格子元素的最后一个tr

时间:2017-06-27 08:45:08

标签: html css

我有一张表{ code:200, message:success, data:String } 正在我的上一个<ul>页面上展开,我试图通过定位我的最后一个td来移动<td>

我正在尝试获取最后一个td&ul;并编辑该特定元素的css。我试图添加以下内容但没有运气。

&#13;
&#13;
<td>
&#13;
  table td:last-child: .dropdown-menu {
  {
    margin: -121px 0 0 0 !important;
  }
&#13;
&#13;
&#13;

如何编辑表格中最后一个td的下拉菜单/ ul?

1 个答案:

答案 0 :(得分:0)

伪代码背后有一个冒号,双花括号。

&#13;
&#13;
table td:last-child .dropdown-menu {
  margin: -121px 0 0 0;
}
&#13;
<table class="my-table">
  <thead>
    <tr>
      <th>1</th>
      <th>2</th>
      <th>3</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>hello</td>
      <td>hello</td>
      <td>
        <span class="dropdown">
    					<button class="btn btn-default dropdown-toggle btn-xs" type="button" id="menu1" data-toggle="dropdown">
    						Actions <span class="caret"></span>
        </button>
        <ul class="dropdown-menu dropdown-menu-right" style="min-width: 100px">
          <li><a style="text-decoration: none !important; cursor: pointer;" class="benefitRecipientDelete">Delete</a></li>
        </ul>
        </span>
      </td>
    </tr>
    <tr>
      <td>hello</td>
      <td>hello</td>
      <td>
        <span class="dropdown">
    					<button class="btn btn-default dropdown-toggle btn-xs" type="button" id="menu1" data-toggle="dropdown">
    						Actions <span class="caret"></span>
        </button>
        <ul class="dropdown-menu dropdown-menu-right" style="min-width: 100px">
          <li><a style="text-decoration: none !important; cursor: pointer;" class="benefitRecipientDelete">Delete</a></li>
        </ul>
        </span>
      </td>
    </tr>
    <tr>
      <td>hello</td>
      <td>hello</td>
      <td>
        <span class="dropdown">
    					<button class="btn btn-default dropdown-toggle btn-xs" type="button" id="menu1" data-toggle="dropdown">
    						Actions <span class="caret"></span>
        </button>
        <ul class="dropdown-menu dropdown-menu-right" style="min-width: 100px">
          <li><a style="text-decoration: none; cursor: pointer;" class="benefitRecipientDelete">Delete</a></li>
        </ul>
        </span>
      </td>
    </tr>
  </tbody>
</table>
&#13;
&#13;
&#13;