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.
Comments
Post a Comment