Results 1 to 2 of 2

Thread: Strech image in table column

  1. #1
    Join Date
    Oct 2011
    Posts
    16

    Strech image in table column

    Dear Experts

    I have following codes

    Code:
    <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/attach...6&d=1320826063
    Please help

  2. #2
    Join Date
    Feb 2006
    Location
    Salisbury UK
    Posts
    4,332
    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/backgroundf...hflexible.html
    Code downloaded to my PC will be deleted in due course.
    WIN7; IE9, Firefox, Opera, Chrome and Safari for Windows; screen resolution usually 1366*768.
    Also IE6 on W98 with 800*600 and IE8 on Vista 1440*900.

Similar Threads

  1. trying to get image to fill in three column DIV
    By zerocommazero in forum Web Design, HTML Reference and CSS
    Replies: 1
    Last Post: 10 Nov 2009, 02:29 PM
  2. 2 table problems. Both have to do with column shifting.
    By Biophilia in forum Web Design, HTML Reference and CSS
    Replies: 0
    Last Post: 14 Jun 2009, 06:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •