www.webdeveloper.com
Results 1 to 5 of 5

Thread: Insert images into table cells

  1. #1
    Join Date
    May 2008
    Posts
    55

    Insert images into table cells

    Hi, I want to insert images into the table cells. Is it possible?
    My code is here but failed.
    Just tried one cell!Thanks.
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title></title>
        <style type="text/css">
            .style1
            {
                font-size: large;
            }
            .style2
            {
                width: 100&#37;;
                height: 584px;
            }
            .style8
            {
                height: 130px;
                width: 218px;
            }
           
            </style>
    </head>
    <body>
    
        <p class="style1" style="text-align: center">
            <strong>2010 AAAAA Activities</strong></p>
       
    
        <table class="style2">
            <tr>
                <td class="style8">
                    <img src="Photos/2010/DSC_0113one.jpg" width="200" /></td>
                <td class="style8">
                    <img alt="" src="" style="width: 200px" /></td>
                <td class="style8">
                    <img alt="" src="" style="height: 200px" /></td>
                <td class="style8">
                    <img alt="" src="" style="height: 200px" /></td>
                <td class="style8">
                    <img alt="" src="" style="width: 200px" /></td>
                <td class="style8">
                    <img alt="" src="" style="width: 200px" /></td>
            </tr>
            <tr>
                <td class="style8">
                    <img alt="" src="" style="width: 200px" /></td>
                <td class="style8">
                    <img alt="" src="" style="width: 220px" /></td>
                <td class="style8">
                    <img alt="" src="" style="height: 200px" /></td>
                <td class="style8">
                    <img alt="" src="" style="width: 200px" /></td>
                <td class="style8">
                    <img alt="" src="" style="width: 200px" /></td>
                <td class="style8">
                    <img alt="" src="" style="height: 200px" /></td>
            </tr>
            <tr>
                <td class="style8">
                    <img alt="" src="" style="width: 200px" /></td>
                <td class="style8">
                    <img alt="" src="" style="width: 200px" /></td>
                <td class="style8">
                    <img alt="" src="" style="width: 200px" /></td>
                <td class="style8">
                    <img alt="" src="" style="width: 200px" /></td>
                <td class="style8">
                    <img alt="" src="" style="width: 200px" /></td>
                <td class="style8">
                    <img alt="" src="" style="width: 200px" /></td>
            </tr>
            <tr>
                <td class="style8">
                    <img alt="" src="" style="width: 200px" /></td>
                <td class="style8">
                    <img alt="" src="" style="width: 200px" /></td>
                <td class="style8">
                    <img alt="" src="" style="width: 200px" /></td>
                <td class="style8">
                    <img alt="" src="" style="width: 200px" /></td>
                <td class="style8">
                    <img alt="" src="" style="width: 200px" /></td>
                <td class="style8">
                    <img alt="" src="" style="width: 200px" /></td>
            </tr>
            <tr>
                <td class="style8">
                    <img alt="" src="" style="width: 200px" /></td>
                <td class="style8">
                    <img alt="" src="" style="width: 200px" /></td>
                <td class="style8">
                    <img alt="" src="" style="width: 200px" /></td>
                <td class="style8">
                    <img alt="" src="" style="width: 200px" /></td>
             </tr>
        </table>
       
    
    </body>
    </html>

  2. #2
    Join Date
    Mar 2010
    Posts
    2,803
    are you sure the path to the file in your src is correct and that the file exists? Probably better to start path names with either / or ./ or ../

  3. #3
    Join Date
    May 2008
    Posts
    55
    Quote Originally Posted by tirna View Post
    are you sure the path to the file in your src is correct and that the file exists? Probably better to start path names with either / or ./ or ../
    I am sure and I did tried ./ something. I heard that only text or background img can be placed in the cells. Is it true?

  4. #4
    Join Date
    Dec 2010
    Posts
    36
    No. You can put images in cells. I do it all of the time for Email advertisements.

    If you're doing it for email ads, it's best to upload the images before linking them, because some emailer clients will break the link of the image. Here's table based email page from me for you to check out the code of:

    http://jonprestonstudios.com/images/...ns/010411.html

    <tr style="background-color:#FFF">
    <td width="180"><img src="sleepbag.jpg" alt="US GI Modular Sleep System &quot;MSS&quot;" width="180" height="155" /></td>
    <td style="font-family:Verdana, Geneva, sans-serif; color:#333; font-size:12px; padding:5 10 10 10">
    <div align="center"; style="padding-bottom:10px"><strong style="font-size:16px; font-weight:bold;">US GI Modular Sleep System "MSS"</strong></div>

    Never wake up cold and wet again! This is the real deal, not an imported after market product that has been showing up in other surplus stores! This U.S. G.I. four part modular sleep system was designed to be used together for temperatures as low as -30&deg;. Here's what's included... One Compression sack (black) for compact storage, one cold weather patrol sleeping bag (black), one intermediate sleeping bag (olive), and one Waterproof/Breathable Bivy cover (woodland camouflage) to keep the whole system dry. This system was designed in layers to trap in pockets of air and heat. The complete system, including the compression sack, weighs roughly twelve pounds. Compare our pricing to others, selling for up to $400.00. Made in the U.S.A. Some compression sacks may have imperfections. Used, Good Condition.<br /><br />
    <span style="color:#003; font:Verdana, Geneva, sans-serif; font-weight:bold;">Price: $125</span></td>
    </tr>

  5. #5
    Join Date
    Sep 2010
    Posts
    20
    Your problem is most certainly a path error, but just in case go ahead and validate the html just to rule out any minuscule errors that could have slipped by.
    http://validator.w3.org/

    Your next step would be to use a FULL path because its guaranteed to work.

    FULL path example.

    http://www.krazyexample.com/folder/supersecretphoto.jpg

    If that works, you can shorten it to /folder/supersecretphoto.jpg
    I have never used ./ like was suggested earlier, but if thats what floats your boat, and it works, go for it.

    Now, if using the FULL path doesn't work you have a couple of possibilities for what could be the problem.
    • misspelled/wrong file name
    • file was not uploaded yet
    • file was placed in the wrong directory
    • misspelled FULL path
    • file is corrupt
    • the government is foiling your plot to take over the world through the censorship of your table photo

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles