Questions › Fix the first row and the first column in a html table when scrolling
schrobe Asked

I have a table in the following form:

<table class="myTable">
  <tbody>
    <tr>
      <td>A1</td>
      <td>B1</td>
      <td>C1</td>
    </tr>
    <tr>
      <td>A2</td>
      <td>B2</td>
      <td>C2</td>
    </tr>
    <tr>
      <td>A3</td>
      <td>B3</td>
      <td>C3</td>
    </tr>
  </tbody>
</table>

Now, as the table has lots of rows and columns I would like the first row (Note that the table does NOT have a <thead> row) and the first column to be fixed when scrolling.

It is possible to use external JavaScript plugins and change the .css style but I can not modify the structure of the original table. In fact, it can only be accessed via the class selector.

Comments :

Check below link that will help you stackoverflow.com/questions/10838700/…

You need to use css. The following link may help you stackoverflow.com/questions/19559197/…


0 Answers :