table: valign-top problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • maya

    table: valign-top problem


    I have an image and right next to the image I have some text, all w/in
    the same <td>.. but, even though I have valign="top" for the <td>, the
    text does not appear on top of the <td>, it appears flush with the
    BOTTOM of the image..

    pls see http://www.mayacove.com/misc/table/table.html

    not sure how to solve this, "text-align:top" does not exist in css....;)

    thank you..



  • Jonathan N. Little

    #2
    Re: table: valign-top problem

    maya wrote:
    >
    I have an image and right next to the image I have some text, all w/in
    the same <td>.. but, even though I have valign="top" for the <td>, the
    text does not appear on top of the <td>, it appears flush with the
    BOTTOM of the image..
    >
    pls see http://www.mayacove.com/misc/table/table.html
    >
    not sure how to solve this, "text-align:top" does not exist in css....;)
    >
    True because the property is called "vertical-align"

    td { vertical-align: top; }
    or
    td { vertical-align: text-top; }





    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO

    Comment

    • rf

      #3
      Re: table: valign-top problem


      "maya" <maya778899@yah oo.comwrote in message news:fp4tts$6io $1@aioe.org...
      >
      I have an image and right next to the image I have some text, all w/in the
      same <td>.. but, even though I have valign="top" for the <td>, the text
      does not appear on top of the <td>, it appears flush with the BOTTOM of
      the image..
      >
      pls see http://www.mayacove.com/misc/table/table.html
      float: left; the image.

      --
      Richard.


      Comment

      • Ben C

        #4
        Re: table: valign-top problem

        On 2008-02-15, maya <maya778899@yah oo.comwrote:
        Jonathan N. Little wrote:
        >maya wrote:
        >>>
        >>I have an image and right next to the image I have some text, all w/in
        >>the same <td>.. but, even though I have valign="top" for the <td>, the
        >>text does not appear on top of the <td>, it appears flush with the
        >>BOTTOM of the image..
        >>>
        >>pls see http://www.mayacove.com/misc/table/table.html
        >>>
        >>not sure how to solve this, "text-align:top" does not exist in css....;)
        >>>
        >>
        >True because the property is called "vertical-align"
        >>
        >td { vertical-align: top; }
        >or
        >td { vertical-align: text-top; }
        >>
        >http://www.w3.org/TR/CSS21/visudet.h...vertical-align
        >>
        >>
        >>
        >
        thank you very much.. unfortunately neither one of these worked..

        >
        the only way text is where I want it is by eliminating the image.. (I
        guess I need to do separate <tdfor img and text, but I was trying to
        avoid that..)
        You can set vertical-align: top on the <ato bring it to the top of its
        line-box (whose height in this case corresponds to that of the <img>).

        .alignTop a { vertical-align: top }

        Or just float the image as rf suggested.

        Comment

        • Beauregard T. Shagnasty

          #5
          Re: table: valign-top problem

          Ben C wrote:
          Or just float the image as rf suggested.
          Did my post not make it to Usenet?

          --
          -bts
          -Friends don't let friends drive Vista

          Comment

          • Bergamot

            #6
            Re: table: valign-top problem

            maya wrote:
            I have an image and right next to the image I have some text, all w/in
            the same <td>.. but, even though I have valign="top" for the <td>, the
            text does not appear on top of the <td>, it appears flush with the
            BOTTOM of the image..
            <imgis aligned at baseline by default. The line-height automatically
            stretches to the height of the image so the text baseline and bottom of
            the image are aligned. Changing the vertical alignment on the td won't
            change this.
            pls see http://www.mayacove.com/misc/table/table.html
            >
            not sure how to solve this, "text-align:top" does not exist in css....;)


            img {vertical-align:top} or
            img {vertical-align:text-top}

            That will align the top of the image with the top of the text. Keep in
            mind that includes space for capital letters and ascenders.

            --
            Berg

            Comment

            • Ben C

              #7
              Re: table: valign-top problem

              On 2008-02-15, Beauregard T. Shagnasty <a.nony.mous@ex ample.invalidwr ote:
              Ben C wrote:
              >
              >Or just float the image as rf suggested.
              >
              Did my post not make it to Usenet?
              Sorry yes you did suggest float as well. My main point was
              vertical-align on the <awhich I didn't think anyone else had
              said.

              Comment

              • maya

                #8
                Re: table: valign-top problem

                Bergamot wrote:
                maya wrote:
                >I have an image and right next to the image I have some text, all w/in
                >the same <td>.. but, even though I have valign="top" for the <td>, the
                >text does not appear on top of the <td>, it appears flush with the
                >BOTTOM of the image..
                >
                <imgis aligned at baseline by default. The line-height automatically
                stretches to the height of the image so the text baseline and bottom of
                the image are aligned. Changing the vertical alignment on the td won't
                change this.
                >
                >pls see http://www.mayacove.com/misc/table/table.html
                >>
                >not sure how to solve this, "text-align:top" does not exist in css....;)
                >

                >
                img {vertical-align:top} or
                img {vertical-align:text-top}
                >
                That will align the top of the image with the top of the text. Keep in
                mind that includes space for capital letters and ascenders.
                that did it! thank you very much....


                Comment

                Working...