0

I have a table here. I want to fixed the first 3 rows (from 'learners name' to 'highest possible score') when I scroll down. and also to fixed the first column (leaders name,highest possible score, including the (male,numbers,and name)) when I scroll right.

I tried to add this to the css

table tbody, table thead{
   display: block;
}

table tbody{
   overflow: auto;
   height: 100px;
}

table {
    width: 350px; /* can be dynamic */
}

th {
    width: 75px;
}

it fixed the column but the table crashed.

Mukesh Ram
  • 6,248
  • 4
  • 19
  • 37
Randy Arguelles
  • 225
  • 1
  • 9

1 Answers1

0

div.fixed {
    position: fixed;
    top:1px
    right: 0;
    width: 100%;
    border: 3px solid #73AD21;
}
.loose{

padding-top:130px;
}
<html>
<head>
</head>
<body>
<div class="fixed">
your  fixed table here
</div>

<div class="loose">

your moving table here, inside loose div 

</div>




</body>
</html>
Santosh Khalse
  • 12,002
  • 3
  • 36
  • 36