Greetings!
I am working on a web page that uses jsf to render the page. The resulting page is built with images nested within tables, so at this juncture, I have no choice but to use tables. The images need to be sized according to the size of the browser window. For instance, I need to fit 2 images across, so they'd each need to be sized at roughly 45% of the page width.
I've boiled the issue down to this simple example...
In this example, the image is sized to the width of the page. If you resize the browser window, the imaged is resized with it.
In this example, the size of the image is static.
Question #1:
I need to get the image to size proportional to the window when the window is resized.
Question #2:
As a side note, if the widths are set to 50%, you'd see the border of the table staying the original width while the image takes up half the cell. Any idea how to get the table size to be 50% with the picture?
Thanks for your help,
snotmare
---------------------
He who has knowledge spares his words, and a man of understanding is of a calm spirit. Even a fool is counted wise when he holds his peace; when he shuts his lips, he is considered perceptive. - King Solomon
I am working on a web page that uses jsf to render the page. The resulting page is built with images nested within tables, so at this juncture, I have no choice but to use tables. The images need to be sized according to the size of the browser window. For instance, I need to fit 2 images across, so they'd each need to be sized at roughly 45% of the page width.
I've boiled the issue down to this simple example...
In this example, the image is sized to the width of the page. If you resize the browser window, the imaged is resized with it.
Code:
<html><body>
<img src="anyimage.jpg" width="100%">
</body></html>
In this example, the size of the image is static.
Code:
<html><body>
<table width="100%" border=1><tr><td width="100%">
<img src="anyimage.jpg" width="100%">
</td></tr></table>
</body></html>
Question #1:
I need to get the image to size proportional to the window when the window is resized.
Question #2:
As a side note, if the widths are set to 50%, you'd see the border of the table staying the original width while the image takes up half the cell. Any idea how to get the table size to be 50% with the picture?
Thanks for your help,
snotmare
---------------------
He who has knowledge spares his words, and a man of understanding is of a calm spirit. Even a fool is counted wise when he holds his peace; when he shuts his lips, he is considered perceptive. - King Solomon