18910140161

HTML-无法更改引导表的TD大小-堆栈溢出

顺晟科技

2022-10-18 13:44:07

225

我在Bootstrap 4中使用了一个名为table-responsive的类的DIV,其中有一个表。我的目标是在移动设备中改变一些表格单元格的大小。

我使用的是 td:nth-child(4),但它只更改第4列的背景颜色,并且大小从不更改。任何想法,我将感谢解决这个问题。非常感谢.

/* For Mobile Portrait View */

@media screen and (max-device-width: 480px) and (orientation: portrait) {
  td:nth-child(4) {
    background-color: red;
    width: 80%;
  }
}


/* For Mobile Landscape View */

@media screen and (max-device-width: 640px) and (orientation: landscape) {
  td:nth-child(4) {
    background-color: red;
    width: 80%;
  }
}


/* For Mobile Phones Portrait or Landscape View */

@media screen and (max-device-width: 640px) {
  td:nth-child(4) {
    background-color: red;
    width: 80%;
  }
}
<代码><;link rel=“ stylesheet ” href=“ UNK1@4.6.0/dist/CSS/bootstrap.min.CSS ” integrity=“ sha384-b0vp5xmatw1+k9krqjqerjvtumqw0npezvf6l/z6nronj3ouofufpcjeuqouq2+l ” crossorigin=“ anonymous ”>;<;DIV类=“表响应”>;<;TABLE CLASS=“ TABLE表格边框表格悬停”>;<;headClass=“ BG-dark text-white ”>;<;TR>;<;th>;#<;/th>;<;th>;Tipo de usuario<;/th>;<;th>;Correo usuario<;/th>;<;th>;Empleado<;/th>;<;th>;Tipo de Empleado<;/th>;<;th>;Fecha de Registro<;/TH>;<;th>;ACTION<;/TH>;<;/tr>;<;/thead>;<;正文(>;)<;TR>;<;Th data-title=“#”>;{{$users->;firstitem()+$index}}<;/Th>;<;TD data-title=“ Tipo Usuario ”>;{{$user->;name}}<;/TD>;<;TD data-title=“ correo usuario ”>;{{$user->;email}}<;/TD>;<;TD data-title=“ Empleado ”>;{Optional($USER->;Employee)->;Name}{Optional($USER-&>;Employee)-&>;Last_名称}<;/TD>;<;TD data-title=“ Tipo Empleado ”>;{{$Employee->;getTypeEmployee(可选($USER->;Employee)-&>;员工_类型_ID)}}<;/TD&>;<;TD data-title=“ Fecha Registro ”>;{{$user->;_创建于}}<;/TD>;<;TD data-title=“ Acción ”>;<;a title=“ ver registro ” href=“{{route(' admin.users.show ',$user->;ID)}}” Class=“ btn-info btn-sm ”>;<;I类=“ Fas FA-EYE ”>;<;/I>;<;/a>;<;a title=“ Editar Registro ” href=“{{route(' admin.users.edit ',$user->;ID)}}” Class=“ btn-success btn-sm ”>;<;I类=“ fa fa-edit ”>;<;/I>;<;/a>;<;a title=“ Eliminar Registro ” href=“{{route(' admin.users.confirm ',$user->;ID)}}” Class=“ btn-danger btn-sm ”>;<;I CLASS=“ fa fa-trash-alt ”>;<;/I>;<;/a>;<;/TD>;<;/tr>;<;/t正文>;<;/表格>;<;/DIV>;


顺晟科技:

  • TAG:
相关文章
我们已经准备好了,你呢?
2024我们与您携手共赢,为您的企业形象保驾护航