New Batch#100 (10th Nov 2021) - Salesforce Admin + Dev Training (WhatsApp: +91 - 8087988044) :https://t.co/p4F3oeQagK

Monday 1 March 2021

Lightning Datatable with fixed horizontal and vertical columns in Salesforce

.THIS .mydiv {
    max-width: 100em !important;
    max-height: 20em !important;
    overflow: scroll;
    position: relative;
  }
   
  .THIS table {
    position: relative;
    border-collapse: collapse;
  }
   
  .THIS td {
    padding: 0.25em;
  }
  .THIS th {
    padding: 0.25em;
  }
   
  .THIS thead th {
    position: -webkit-sticky !important; /* for Safari */
    position: sticky !important;
    top: 0;
    z-index: 1;
  }

  .THIS table thead th:first-child {
    position: sticky !important;
    left: 0;
    z-index: 2;
  }
  
  .THIS table tbody th {
    position: sticky !important;
    left: 0;
    background: white;
    z-index: 1;
  }

Labels