daily pastebin goal
36%
SHARE
TWEET

Untitled

a guest Jan 16th, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <div>
  2.     <table>
  3.         <tr>
  4.             <td class="sticky left">Sticky</td>
  5.             <td class="sticky" colspan="9">How can I make this sticky?</td>
  6.         </tr>
  7.         <tr class="tableBody">
  8.             <td>Column 1</td>
  9.             <td>Column 2</td>
  10.             <td>Column 3</td>
  11.             <td>Column 4</td>
  12.             <td>Column 5</td>
  13.             <td>Column 7</td>
  14.             <td>Column 8</td>
  15.             <td>Column 9</td>
  16.             <td>Column 10</td>
  17.         </tr>
  18.     </table>
  19. </div>
  20.    
  21. div {
  22.   width: 300px;
  23.   overflow: scroll;
  24. }
  25. .sticky {
  26.   position: fixed;
  27.   left: 50px;
  28.   background: white;
  29. }
  30. .left{
  31.   left:0;
  32. }
  33. tr.tableBody
  34. {
  35.    line-height:50px;
  36. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top