0

Im trying to do a table with fixed column and scrolls like the following link: http://hazaa.com.au/blog/how-to-create-an-html-table-with-frozen-headers-and-columns/

Source code:https://onedrive.live.com/?cid=5e237543fffb2891&id=5E237543FFFB2891%21192

The point is that in this sample, the table have fixed width and heights in "px", and im needed that table fits according to the screen (replace the fixed "px" to "%").

Can someone help me on that? When i make the changes, i'm really can't bring up the vertical scroll!!

Thanks!!

1
  • Have you looked into the datatables.net library. I believe it will do everything you need and is very robust. Commented Apr 30, 2015 at 23:59

1 Answer 1

1

Put a div inside the columns, text inside the div. Set height:100% on everything (especially html and body), width: 100% on the table and overflow: auto on the div

(Demo)

html,body {
    padding: 0;
    margin: 0;
    height: 100%;
}
table {
    width: 100%;
    height: 100%;
}
div {
    height: 100%;
    overflow: auto;
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.