Skip to content

Instantly share code, notes, and snippets.

@iamrealfarhanbd
Last active September 14, 2023 09:16
Show Gist options
  • Save iamrealfarhanbd/e5a1a2011c218b7ff6396a2c589046af to your computer and use it in GitHub Desktop.
Save iamrealfarhanbd/e5a1a2011c218b7ff6396a2c589046af to your computer and use it in GitHub Desktop.
Custom CSS code to make the left two columns of a Ninja Table sticky when scrolling to the right.
#footable_parent_NT_ID tbody tr td:nth-child(1), #footable_parent_NT_ID thead th:nth-child(1){
position: sticky;
position: -webkit-sticky;
left: 0;
z-index: 1;
background: #fafafb;
font-weight:bold;
}
#footable_parent_NT_ID tbody tr td:nth-child(2), #footable_parent_NT_ID thead th:nth-child(2){
position: sticky;
position: -webkit-sticky;
left: 170px; /*You need to adjust position of 2nd column*/
z-index: 1;
background: #fafafb;
font-weight:bold;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment