How can I fix Labels?

0

I will try to explain myself as best I can. I am currently set up a web page, and I have some labels that do as a header for others, the problem is that when I descend the page the headers also go up and I need all the time to be seen at the top, and I tried to adjust that but I have had some problems, I will attach some images to you to see it.

The first image is what it looks like when I'm at the top of the page, the second image is what happens when I go down, and the third is the code of the labels that I need static. I would be very grateful if you could help me to leave those labels static and when they come down they will stay fixed on the top to follow them as they go down.

    
asked by 06.02.2018 в 15:46
source

1 answer

0

I think that using plugins that already do the work is quite simple, there are many of them, here I refer to one of them

link

Where the only thing to do is:

$('selector').fixedHeaderTable({
    footer: true,
    cloneHeadToFoot: true,
    fixedColumn: false 
});

selector, is the selector of your table, the only thing to keep in mind is that the table must be of the form:

<table>
  <thead>
    <tr>
          <th></th>
    </tr>
  </thead>
  <tfoot>
    <tr>
      <td></td>
    </tr>
  </tfoot>
  <tbody>
    <tr>
      <td></td>
    </tr>
  </tbody>
</table>

footer makes it possible to put some info at the end of the table, cloneHeadToFoot causes the header to also be fixed at the end of the table, fixedColumn causes the first column to be fixed as well, so the plugin has good options, it has MIT license and a couple of useful methods. I hope it helps.

    
answered by 06.02.2018 / 16:27
source