html - css: table scrollable both horizontally and vertically with fixed header -


how can implement table both horizontally , vertically scrollable fixed header using css?

i found scrolling div outer div, implemented using javascript/jquery. way implement using css?

the updated code:

#div-table-content { width: 100%; overflow-x: auto; }  table { font-size: 12px; white-space:nowrap; overflow-x: scroll; }  tbody { height: 400px; overflow-y: auto; width: 100%; display: block; }  thead tr { display: block; width: 100%; } 

for start divide <table> semantically headers inside <thead> , content inside <tbody>.

then, vertical scrolling, give fixed height <tbody> , set overflow-y: auto , display: block.

for horizontal scrolling, belive have wrap entire table container (lets <div> , give fixed width , overflow-x: auto.

jsfiddle demo


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -