PDA

View Full Version : Strech image in table column



tqm1
09 Nov 2011, 03:09 AM
Dear Experts

I have following codes


<html>
<head><h1>Image and data in table column</h1></head>

<style type="text/css">

.bg {widht:100%;height:100%}
.al {text-align:center;}


</style>

<body>

<table width="50%" height="100px" border="1" cellpadding='0' cellspacing="0">
<tr>
<td widht="25%" background="DREAM.JPG" tabindex="2" title="The Code Project"><h3 class="al">Hello</h3></td>

<td widht="25%" bgcolor=pink><h3>world</h3></td>

</tr>
</table>

</body>
</html>

In column I want to stretch this image
http://www.daniweb.com/forums/attachment.php?attachmentid=22856&d=1320826063
Please help

Wickham
09 Nov 2011, 03:46 AM
Unfortunately background images cannot stretch, except using CSS3 in % which isn't supported by all browsers yet, see
http://www.css3.info/preview/background-size/ and
http://www.findmebyip.com/litmus/

You should always have a doctype above your <html> tag from here:-
http://www.w3.org/QA/2002/04/valid-dtd-list.html

Also spell width not widht

If you use a <img> instead of a background image you can use position: absolute or position: fixed and width: 100%; left: 0; right: 0; and a z-index and position it behind your content but that is a little more complicated, see
http://www.wickham43.net/backgroundfullwidthflexible.html