位置粘性在 Firefox 中有效,在 Chrome 中无效

阿卡迪2k

我在一个管理面板网站上工作,我已经将表格标题上的位置设置为粘性。它似乎在 Mozilla Firefox 中运行良好,但在 Chrome 中不起作用。我在前端使用 Materialise,在后端使用 Laravel。

我试过将 .table-wrapper 的位置设置为相对位置,但它什么也没做。没有在任何元素上设置溢出或高度属性。

<table id="importuri-table" class="striped table-wrapper" res="înregistrarea">
    <thead>
      <tr>
        <th field="data">Data<i class="material-icons">sort</i></th>
        <th field="id">Nr. Fi<i class="material-icons">sort</i></th>
        <th field="status_plan">Status plan<i class="material-icons">sort</i></th>
        <th field="tip_transport">Tip trans<i class="material-icons">sort</i></th>
        <th field="transportator">Transportator<i class="material-icons">sort</i></th>
        <th field="autonr">Auto<i class="material-icons">sort</i></th>
        <th field="sofer">Sofer<i class="material-icons">sort</i></th>
        <th field="telefon">Telefon<i class="material-icons">sort</i></th>
        <th field="destinatie">Destinație<i class="material-icons">sort</i></th>
        <th field="valoare">Valoare<i class="material-icons">sort</i></th>
        <th field="valuta">Valuta<i class="material-icons">sort</i></th>
        <th width="200px">Actiuni</th>
      </tr>
      <tr>
        @for ($i = 0; $i < 11; $i++)
          <td>
            <div class="input-field">
              <input class="browser-default @if (in_array($i, [2, 3, 10])) autocomplete @endif" type="text" placeholder="Filtreaza dupa {{ ['dată', 'nr. FI', 'status plan', 'tip transport', 'transportator', 'nr. auto', 'șofer', 'telefon', 'destinație', 'valoare', 'valută'][$i] }}">
            </div>
          </td>
        @endfor

        <td><i class="material-icons blue-text resetfilter">autorenew</i></td>
      </tr>
    </thead>
    <tbody>
      @foreach ($importuri as $import)
        <tr>
          <td>{{ $import->data }}</td>
          <td>{{ $import->id }}</td>
          <td>{{ $import->status_plan }}</td>
          <td>{{ $import->tip_transport }}</td>
          <td>{{ $import->transportator }}</td>
          <td>{{ $import->autonr }}</td>
          <td>{{ $import->sofer }}</td>
          <td>{{ $import->telefon }}</td>
          <td>{{ $import->destinatie }}</td>
          <td>{{ $import->valoare }}</td>
          <td>{{ $import->valuta }}</td>
          <td>
            <a href="{{ route('importuri.edit', ['import' => $import->id]) }}"><i class="modal-trigger material-icons blue-text waves-effect waves-dark tooltipped" data-position="top" data-tooltip="Editează" href="#import-edit">edit</i></a>
            <i class="modal-trigger material-icons red-text waves-effect waves-dark tooltipped" data-position="top" data-tooltip="Șterge" href="#you-sure" action="{{ route('importuri.destroy', ['import' => $import->id]) }}">clear</i>
          </td>
        </tr>
      @endforeach
    </tbody>
  </table>
.table-wrapper {
  border: 1px solid #ddd;
  background-color: #fff;
  position: relative;

  > thead {
    background-color: #ddd;
    position: sticky;
    top: 0;
    z-index: 3;
  }
}

尚穆根圣达拉姆

尝试应用位置:粘性;到 th 而不是 thead。例子:

.table-wrapper {
    border: 1px solid #ddd;
    background-color: #fff;
    position: relative;

    > thead {   
        th{
            background-color: #ddd;
            z-index: 3;
            position: sticky;
            top: 0;
        }
    }
}   

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

表格在Firefox中无法响应,在Chrome中有效

来自分类Dev

内联在 CSS 中的 SVG 在 Chrome/Edge 中有效,但在 Firefox 中无效

来自分类Dev

链接在Firefox中有效,但在Chrome和Safari中无效

来自分类Dev

解构错误对象在Chrome中有效,但在Firefox中无效。该怎么办?

来自分类Dev

jQuery Click 功能在 Firefox 中有效,但在 Chrome/Safari 中无效

来自分类Dev

Selenium 测试用例在 Firefox 中有效,但在 Chrome 中无效 - Headless Setup

来自分类Dev

伪元素在 Firefox 中有效,但在 Chrome 中无效,为什么?

来自分类Dev

为什么此 JavaScript css 过滤器代码在 Firefox 中有效,而在 Chrome 中无效?

来自分类Dev

在相对位置<li>中的绝对位置<img>在chrome&IE11中有效,而不在Firefox中工作

来自分类Dev

单选按钮在Firefox中有效,但在Chrome中不可点击

来自分类Dev

preventDefault for save popup在chrome中有效,但在Firefox中不可用

来自分类Dev

Javascript下载在firefox中停止,但在Chrome中有效

来自分类Dev

单一测试在PhantomJS中失败,但在Chrome和Firefox中有效

来自分类Dev

通过PHP设置Cookie在Chrome中有效,但在Firefox或IE中不起作用

来自分类Dev

jQuery error()在Chrome和IE中有效,但在Firefox中不起作用

来自分类Dev

Rmarkdown flexdashboard值框在Chrome或IE中无法正确呈现(但在FireFox中有效)

来自分类Dev

动态生成的html链接在Firefox中有效,但在Chrome中不起作用

来自分类Dev

解析XML标签属性在Firefox中有效,但在Chrome中不起作用

来自分类Dev

我的专栏文章将在Firefox / Safari中换行,但在Chrome中有效

来自分类Dev

添加的间距在Firefox中有效,但在Chrome和Safari中不起作用

来自分类Dev

window.open在Firefox中有效,但在IE或Chrome中不起作用

来自分类Dev

日期差异在Firefox和IE中有效,但在Chrome中返回NaN

来自分类Dev

CSS剪切路径在Firefox中有效,但在chrome中不可用

来自分类Dev

按特定键在JavaScript中执行某些操作在Chrome中有效,但在Firefox中不起作用

来自分类Dev

为什么HTML复选框功能仅在IE中有效,而在Firefox或Chrome中不起作用?

来自分类Dev

在Chrome或Firefox中,jquery $ .ajax调用会导致401未经授权的响应,但在IE中有效

来自分类Dev

量角器测试在Firefox中失败(无法找到ID),但在ie / chrome中有效

来自分类Dev

我的音频可视化器在Chrome中不起作用(但在Firefox中有效)

来自分类Dev

为什么HTML复选框功能仅在IE中有效,而在Firefox或Chrome中不起作用?

Related 相关文章

  1. 1

    表格在Firefox中无法响应,在Chrome中有效

  2. 2

    内联在 CSS 中的 SVG 在 Chrome/Edge 中有效,但在 Firefox 中无效

  3. 3

    链接在Firefox中有效,但在Chrome和Safari中无效

  4. 4

    解构错误对象在Chrome中有效,但在Firefox中无效。该怎么办?

  5. 5

    jQuery Click 功能在 Firefox 中有效,但在 Chrome/Safari 中无效

  6. 6

    Selenium 测试用例在 Firefox 中有效,但在 Chrome 中无效 - Headless Setup

  7. 7

    伪元素在 Firefox 中有效,但在 Chrome 中无效,为什么?

  8. 8

    为什么此 JavaScript css 过滤器代码在 Firefox 中有效,而在 Chrome 中无效?

  9. 9

    在相对位置<li>中的绝对位置<img>在chrome&IE11中有效,而不在Firefox中工作

  10. 10

    单选按钮在Firefox中有效,但在Chrome中不可点击

  11. 11

    preventDefault for save popup在chrome中有效,但在Firefox中不可用

  12. 12

    Javascript下载在firefox中停止,但在Chrome中有效

  13. 13

    单一测试在PhantomJS中失败,但在Chrome和Firefox中有效

  14. 14

    通过PHP设置Cookie在Chrome中有效,但在Firefox或IE中不起作用

  15. 15

    jQuery error()在Chrome和IE中有效,但在Firefox中不起作用

  16. 16

    Rmarkdown flexdashboard值框在Chrome或IE中无法正确呈现(但在FireFox中有效)

  17. 17

    动态生成的html链接在Firefox中有效,但在Chrome中不起作用

  18. 18

    解析XML标签属性在Firefox中有效,但在Chrome中不起作用

  19. 19

    我的专栏文章将在Firefox / Safari中换行,但在Chrome中有效

  20. 20

    添加的间距在Firefox中有效,但在Chrome和Safari中不起作用

  21. 21

    window.open在Firefox中有效,但在IE或Chrome中不起作用

  22. 22

    日期差异在Firefox和IE中有效,但在Chrome中返回NaN

  23. 23

    CSS剪切路径在Firefox中有效,但在chrome中不可用

  24. 24

    按特定键在JavaScript中执行某些操作在Chrome中有效,但在Firefox中不起作用

  25. 25

    为什么HTML复选框功能仅在IE中有效,而在Firefox或Chrome中不起作用?

  26. 26

    在Chrome或Firefox中,jquery $ .ajax调用会导致401未经授权的响应,但在IE中有效

  27. 27

    量角器测试在Firefox中失败(无法找到ID),但在ie / chrome中有效

  28. 28

    我的音频可视化器在Chrome中不起作用(但在Firefox中有效)

  29. 29

    为什么HTML复选框功能仅在IE中有效,而在Firefox或Chrome中不起作用?

热门标签

归档