In JSF, I am using panelGrid which is equivalent to table in html. How to set height=100% in it? width=100% exists but not height.
Thanks
In JSF, I am using panelGrid which is equivalent to table in html. How
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To start, JSF is irrelevant here. It’s now all about its generated HTML code. Open page in webbrowser, rightclick and view source. Concentrate you on that HTML source. That’s all what CSS (and JS) can see and apply.
I assume that you mean with 100% height the full viewport height (the “visible” height). Now, to achieve full viewport height in CSS, only setting a
height: 100%on the desired HTML element itself is not sufficient. It will be relative to its parent element, all the chain up to the<html> element. So if you basically have a:It will be 100% of the height of the
<body>element. The height of the<body>itself is in turn relative to the height of the<html>element. But the both elements doesn’t have a height of 100%. Copy’n’paste’n’run it. You’ll see, it does not cover the full viewport.If you want to achieve a full viewport height, then you need to apply
height: 100%on both the<body>and<html>elements as well (you of course also need to reset the margins).Apply this knowledge on JSF as well. The
h:panelGridjust renders a<table>element. ItsstyleClasswill be rendered as HTMLclassattribute.