Ask Your Question
0

What steps can be taken to enable vertical scrolling in tbody and have it automatically fill its containing element?

asked 2023-07-10 08:56:59 +0000

david gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2023-07-10 09:03:02 +0000

pufferfish gravatar image

Here are the steps to enable vertical scrolling in tbody and have it automatically fill its containing element:

  1. Set the height of the containing element that houses the tbody. Since we want vertical scrolling, use a fixed height value. For example:
.containing-element {
  height: 300px;
}
  1. Set the tbody element to be display: block. This will allow the tbody element to have its own height property and enable scrolling within it.
tbody {
  display: block;
}
  1. Set the height of tbody to be 100%. This will ensure that the tbody element stretches to fill the containing element height.
tbody {
  display: block;
  height: 100%;
}
  1. Add the CSS property overflow-y: auto to the tbody element. This will enable vertical scrolling within the tbody element.
tbody {
  display: block;
  height: 100%;
  overflow-y: auto;
}

With these CSS properties applied, the tbody element will now have vertical scrolling and automatically fill its containing element height.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-07-10 08:56:59 +0000

Seen: 11 times

Last updated: Jul 10 '23