Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
728 views
in Technique[技术] by (71.8m points)

html - Quasar QMarkupTable th sticky header not working

I am using Quasar's [QMarkupTable] (https://quasar.dev/vue-components/markup-table#Installation) and I am trying to make the header sticky but it isn't working.

.my-sticky-header-table
  /* height or max-height is important */
  height: 600px

  .q-table__top,
  .q-table__bottom,
  thead tr:first-child th
    /* bg color is important for th; just specify one */
    background-color: #fff

  thead tr th
    position: sticky
    z-index: 1
    top: 0
  thead tr:first-child th
    top: 0

  /* this is when the loading indicator appears */
  &.q-table--loading thead tr:last-child th
    /* height of all previous header rows */
    top: 48px

The HTML

<q-markup-table
      wrap-cells
      class="shadow-1 my-sticky-header-table"
      virtual-scroll
      :pagination.sync="pagination"
      :rows-per-page-options="[100]"
      separator="none"
    >
      <thead>
          <tr>
            <th>
            </th> 
            <th>
            </th>
          </tr>
     </thead>
     <tbody>
     </tbody>
  </q-markup-table>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...