467,907 Members | 1,368 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,907 developers. It's quick & easy.

Center Image in page

hsriat
Expert 1GB
How can i render an image in the center of a page.

I did this: [html]<table width="100%" heigth="100%">
<tr>
<td valign="middle" align="center"><img...... /></td>
</tr>
</table>[/html]
Mar 4 '08 #1
  • viewed: 3884
Share:
4 Replies
drhowarddrfine
Expert 4TB
That works for me. .
Mar 4 '08 #2
hsriat
Expert 1GB
That works for me. .
It does, but without any doctype.
Gives validation error with the height attribute and height doesn't become 100%.
Mar 4 '08 #3
drhowarddrfine
Expert 4TB
Not sure I understand but try this:
[HTML]<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
html,body{height:100%;width:100%;margin:0}
table{height:100%;width:100%;}
table tr td {text-align:center}
</style>
</head>
<body>
<table border=1>
<tr>
<td><img src="1.png" alt=""></td>
</tr>
</table>

</body>
</html>[/HTML]
Mar 4 '08 #4
hsriat
Expert 1GB
Not sure I understand but try this:
[HTML]<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
html,body{height:100%;width:100%;margin:0}
table{height:100%;width:100%;}
table tr td {text-align:center}
</style>
</head>
<body>
<table border=1>
<tr>
<td><img src="1.png" alt=""></td>
</tr>
</table>

</body>
</html>[/HTML]
Yeah that works.

Thanks...
Mar 4 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

7 posts views Thread by Sean | last post: by
roula
19 posts views Thread by roula | last post: by
14 posts views Thread by Summercool | last post: by
2 posts views Thread by jerrygadd | last post: by
14 posts views Thread by gaijinco | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.