Professional Web Applications Themes

Fitting an image into a table cell - ASP Components

I am trying to fit an image correctly into a TD so that there is no extra space visible above, below, or to the left of it. I do not mind if there is extra space to the right (I am putting text there). At the moment I have gotten rid of all space above and to the left, but the text keeps aligning it's baseline with the bottom of the graphic even when I put the valign="top" attribute in the TD. My code for the table is as follows: <TABLE BORDER=1 WIDTH=175 BORDERCOLOR="#000000" CELLPADDING=0 CELLSPACING=0> <TR> <TD WIDTH=175 HEIGHT=21 ...

  1. #1

    Default Fitting an image into a table cell

    I am trying to fit an image correctly into a TD so that there is no extra
    space visible above, below, or to the left of it. I do not mind if there is
    extra space to the right (I am putting text there). At the moment I have
    gotten rid of all space above and to the left, but the text keeps aligning
    it's baseline with the bottom of the graphic even when I put the
    valign="top" attribute in the TD. My code for the table is as follows:

    <TABLE BORDER=1 WIDTH=175 BORDERCOLOR="#000000" CELLPADDING=0 CELLSPACING=0>
    <TR>
    <TD WIDTH=175 HEIGHT=21 BGCOLOR="#C8C8FF">
    <IMG SRC="/images/locarrowplaceholder.GIF" WIDTH=12 HEIGHT=21>
    <FONT FACE="Arial,Helvetica" SIZE=2 COLOR="#000000">
    <A HREF="/index.asp">Life With Nate</A>
    </FONT>
    </TD>
    </TR>
    </TABLE>

    The width and height attributes in the IMG tag are correct, but what looks
    like 2 pixels appear below the IMG, which is equal to the amount of space
    taken up by the tails on the text of other text I tried putting in the
    anchor tag. If anyone has any suggestions, please let me know. Thank You.
    --
    Nathan Sokalski
    [email]njsokalskihotmail.com[/email]


    Nathan Sokalski Guest

  2. #2

    Default Re: Fitting an image into a table cell

    "Nathan Sokalski" wrote:
    > I am trying to fit an image correctly into a TD so that there is no extra
    > space visible above, below, or to the left of it. I do not mind if there
    is
    > extra space to the right (I am putting text there). At the moment I have
    > gotten rid of all space above and to the left, but the text keeps aligning
    > it's baseline with the bottom of the graphic even when I put the
    > valign="top" attribute in the TD. My code for the table is as follows:
    >
    > <TABLE BORDER=1 WIDTH=175 BORDERCOLOR="#000000" CELLPADDING=0
    CELLSPACING=0>
    > <TR>
    > <TD WIDTH=175 HEIGHT=21 BGCOLOR="#C8C8FF">
    > <IMG SRC="/images/locarrowplaceholder.GIF" WIDTH=12 HEIGHT=21>
    > <FONT FACE="Arial,Helvetica" SIZE=2 COLOR="#000000">
    > <A HREF="/index.asp">Life With Nate</A>
    > </FONT>
    > </TD>
    > </TR>
    > </TABLE>
    >
    > The width and height attributes in the IMG tag are correct, but what looks
    > like 2 pixels appear below the IMG, which is equal to the amount of space
    > taken up by the tails on the text of other text I tried putting in the
    > anchor tag. If anyone has any suggestions, please let me know. Thank You.
    > --
    > Nathan Sokalski
    > [email]njsokalskihotmail.com[/email]
    Nathan...

    Here is one way:
    <TABLE BORDER=1 WIDTH=175 BORDERCOLOR="#000000" CELLPADDING=0 CELLSPACING=0>
    <TR>
    <TD WIDTH=175 HEIGHT=21 BGCOLOR="#C8C8FF">
    <IMG SRC="/images/locarrowplaceholder.GIF" style="width: 12px; height:
    21px; vertical-align: bottom" />
    <FONT FACE="Arial,Helvetica" SIZE=2 COLOR="#000000">
    <A HREF="/index.asp">Life With Nate</A>
    </FONT>
    </TD>
    </TR>
    </TABLE>

    Here is another:
    <div style="border: 1px solid black; width: 175px; padding: 0px; margin:
    0px">
    <span style="width: 175px; height: 21px; background-color: #c8c8ff; font:
    normal 12px arial, helvetica, sans-serif; color: black">
    <img src="/images/locarrowplaceholder.GIF" style="width: 12px; height:
    21px; vertical-align: bottom" /><a href="/index.asp">Life With Nate</a>
    </span>
    </div>

    --
    Roland

    This information is distributed in the hope that it will be useful, but
    without any warranty; without even the implied warranty of merchantability
    or fitness for a particular purpose.


    Roland Hall Guest

  3. #3

    Default Re: Fitting an image into a table cell

    Hi Nathan!
    <IMG SRC="/images/locarrowplaceholder.GIF" WIDTH=12 HEIGHT=21
    align=absbottom>
    will help you.

    Best wishes!

    Andrew Fedoniouk.
    [url]http://terrainformatica.com[/url] - home of HtmLayout




    "Nathan Sokalski" <njsokalskihotmail.com> wrote in message
    news:#oQTlHcxDHA.2556TK2MSFTNGP10.phx.gbl...
    | I am trying to fit an image correctly into a TD so that there is no extra
    | space visible above, below, or to the left of it. I do not mind if there
    is
    | extra space to the right (I am putting text there). At the moment I have
    | gotten rid of all space above and to the left, but the text keeps aligning
    | it's baseline with the bottom of the graphic even when I put the
    | valign="top" attribute in the TD. My code for the table is as follows:
    |
    | <TABLE BORDER=1 WIDTH=175 BORDERCOLOR="#000000" CELLPADDING=0
    CELLSPACING=0>
    | <TR>
    | <TD WIDTH=175 HEIGHT=21 BGCOLOR="#C8C8FF">
    | <IMG SRC="/images/locarrowplaceholder.GIF" WIDTH=12 HEIGHT=21>
    | <FONT FACE="Arial,Helvetica" SIZE=2 COLOR="#000000">
    | <A HREF="/index.asp">Life With Nate</A>
    | </FONT>
    | </TD>
    | </TR>
    | </TABLE>
    |
    | The width and height attributes in the IMG tag are correct, but what looks
    | like 2 pixels appear below the IMG, which is equal to the amount of space
    | taken up by the tails on the text of other text I tried putting in the
    | anchor tag. If anyone has any suggestions, please let me know. Thank You.
    | --
    | Nathan Sokalski
    | [email]njsokalskihotmail.com[/email]
    |
    |


    Andrew Fedoniouk Guest

Similar Threads

  1. Getting the column from a table cell
    By zahidayar@gmail.com in forum ASP.NET Data Grid Control
    Replies: 2
    Last Post: October 25th, 07:06 PM
  2. Centre image in table cell
    By Slistress@adobeforums.com in forum Adobe Indesign Windows
    Replies: 2
    Last Post: July 21st, 12:41 PM
  3. Can You insert just a cell in a table?
    By HIcks@adobeforums.com in forum Adobe Indesign Windows
    Replies: 2
    Last Post: July 20th, 02:48 PM
  4. Fitting an image to the artboard dimensions
    By bill0199@adobeforums.com in forum Adobe Illustrator Windows
    Replies: 1
    Last Post: June 1st, 10:09 PM
  5. Using a rollover to kick off a flash in a different table/table cell
    By xril webforumsuser@macromedia.com in forum Macromedia Dreamweaver
    Replies: 0
    Last Post: July 18th, 05:52 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139