Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: table help  (Read 3794 times)

0 Members and 1 Guest are viewing this topic.

nymph4

    Topic Starter


    Specialist

    table help
    « on: June 30, 2010, 10:37:22 AM »
    I think I am useing my Table Data Code incorect.
    I have a photo and text under it in a Table Cell and I want it to be Centered in the cell so I thought I do this.

    <TD BGCOLOR="#000000" VALIGN="TOP" ALIGN="CENTER">
    <img src="house A1.jpg" height="45">
    <BR>
    <p>
    Home Page.
    </p>
    </TD>

    The photo goes to the TOP of the cell why??

    BC_Programmer


      Mastermind
    • Typing is no substitute for thinking.
    • Thanked: 1140
      • Yes
      • Yes
      • BC-Programming.com
    • Certifications: List
    • Computer: Specs
    • Experience: Beginner
    • OS: Windows 11
    Re: table help
    « Reply #1 on: June 30, 2010, 10:57:03 AM »
    because you told it to.
    I was trying to dereference Null Pointers before it was cool.

    umbra



      Beginner
    • Thanked: 2
      • Experience: Familiar
      • OS: Windows 7
      Re: table help
      « Reply #2 on: June 30, 2010, 01:14:16 PM »
      Hi,
       
       Having a first look , as BC says you have "VALIGN="TOP" so  it goes on top of the cell , remove this property and let only ALIGN="CENTER" so the content of <td> will be centered (horizontally), and vertical alignment will be the default one.

       If you need more help about this , please let me know.

      Radu
      Trying to don't waste my time.  :)

      nymph4

        Topic Starter


        Specialist

        Re: table help
        « Reply #3 on: June 30, 2010, 09:03:34 PM »
        Here is the whole code I am using and the first two cells have the photo  centered  but all the other cells have the photos going to the top center?????????
        Why

        <TABLE BORDER="0" cellspacing="5">
        <TR>

        <td bgcolor="#000000" align="center" valign="middle">
        <img src="mail.gif" height="45">
        <BR>
        <p>
        E-MAIL THE ARTIST.
        </p>
        </TD>

        <td bgcolor="#000000" align="center" valign="middle">
        <img src="house A1.jpg" height="45">
        <BR>
        <p>
        HOME PAGE.
        </p>
        </TD>

        <td bgcolor="#000000" align="center" valign="middle">
        <img src="folder.jpg" height="55">
        <BR>
        <p>
        ARTIST RESUME PAGE.
        </p>
        </TD>
        </TR>

        <TR>
        <td bgcolor="#000000" align="center" valign="middle">
        <img src="print A2.jpg" height="55">
        <BR>
        <p>
        SPRING GALLERY PAGE.
        </p>
        </TD>

        <td bgcolor="#000000" align="center" valign="middle">
        <img src="print E41.jpg" height="55">
        <BR>
        <p>
        FALL GALLERY PAGE.
        </p>
        </TD>

        <td bgcolor="#000000" align="center" valign="middle">
        <img src="print E45.jpg" height="55">
        <BR>
        <p>
        WINTER GALLERY PAGE.
        </p>
        </TD>
        </TR>
        </TABLE>
        <BR>

        kpac

        • Web moderator
        • Moderator


        • Hacker

        • kpac®
        • Thanked: 184
          • Yes
          • Yes
          • Yes
        • Certifications: List
        • Computer: Specs
        • Experience: Expert
        • OS: Windows 7
        Re: table help
        « Reply #4 on: July 01, 2010, 03:35:58 AM »
        It's because you have a paragraph underneath the image. If you set the td valign to middle everything together in the td is centered, not just images.

        nymph4

          Topic Starter


          Specialist

          Re: table help
          « Reply #5 on: July 01, 2010, 10:15:57 AM »
          Yes I know this
          But the first two images with text under it in the cells work good.

          The other cells move the images up to the top and  I think there is room for it to center the text and images  but they don't in the other cells.

          nymph4

            Topic Starter


            Specialist

            Re: table help
            « Reply #6 on: July 02, 2010, 07:44:07 PM »
            OK my link to my page I need help with is
            www.robertsartgallery.com

            You will see a Table at the top left hand side of the main page.

            The photo of a  Mail Box  and  House  all have text under them and they are all Centered in the Cells  great   you can see a Little room on top and under them in the Cells.

            When you get to the photos for the Spring Gallery and the  Fall Gallery  you will see thephotos are all pushed to the tops of there Cell????????????????

            Why can't I get every photo in every Cell to be Centered????

            2x3i5x



              Expert
            • Thanked: 134
            • Computer: Specs
            • Experience: Familiar
            • OS: Windows 10
            Re: table help
            « Reply #7 on: July 02, 2010, 07:50:40 PM »
            sorry not to be about the table help you're requesting but...

            I tried visiting your page in internet explorer and I'm seeing

            Code: [Select]
            p{color:white;font-family:Times New Roman, Arial;} h1{text-decoration:underline;color:white;font-family:Times New Roman,Arial;}
            body{background-image: url(wall.jpg);}
            a:link{color:#FFFF00;} a:visited{color:##FFFF00;} a:hover{color:#FFFF00;} a:focus{color:#FFFF00;} a:active{color:#FFFF00;}

            on the top of the page. 
            « Last Edit: July 03, 2010, 08:18:47 AM by kpac »

            umbra



              Beginner
            • Thanked: 2
              • Experience: Familiar
              • OS: Windows 7
              Re: table help
              « Reply #8 on: July 03, 2010, 04:41:10 AM »
              Hi again nymph4 ,

               I copy paste your html code and test it on my local machine using FireFox 3.6 (also there could be some browser specific issues but with this html code i doubt about this), all the pictures were align centered as you mentioned , in your html, i could not find
              any strange behavior for your html , code, it performs right.
               
               Pictures seems to be vertical align (only using default height of cell) because you have some content after them in cell, those <p> and br>.

               If you want to test this alignment just increase the height of a cell , and you will see that its content (img and p) will be centered.

               Try for example this code for a cell:

              <td bgcolor="#000000" align="center" valign="middle" height="1000px">
              <img src="house A1.jpg" height="45">
              <BR>
              <p>
              HOME PAGE.
              </p>
              </TD>

              and you will see that content is centered.

              If you want that this requirement to be seen on your page  increase the height of cells. (td elements)


              Hope this helps ;).


              Regards,
              Radu
               
              Trying to don't waste my time.  :)

              nymph4

                Topic Starter


                Specialist

                Re: table help
                « Reply #9 on: July 03, 2010, 12:50:27 PM »
                I will try what you told me with the Hight of the Cells.

                But what I ment is this.

                The photo of the Mail Box is Centered in the Cell and you can see a Little Black of the Cell color at the top of the photo.

                My other photos like the Spring photo and  Fall Photo  even if I make the photos  very very small    they will be centered in the Cell but go all the way to the top and you don't see any Black at the top of the Cell  Like with the photo of the Mail Box???

                kpac

                • Web moderator
                • Moderator


                • Hacker

                • kpac®
                • Thanked: 184
                  • Yes
                  • Yes
                  • Yes
                • Certifications: List
                • Computer: Specs
                • Experience: Expert
                • OS: Windows 7
                Re: table help
                « Reply #10 on: July 03, 2010, 01:21:57 PM »
                 ::)

                Quote
                The photo of the Mail Box is Centered in the Cell and you can see a Little Black of the Cell color at the top of the photo.
                The first two images are not high enough.

                nymph4

                  Topic Starter


                  Specialist

                  Re: table help
                  « Reply #11 on: July 03, 2010, 03:16:58 PM »
                  OK I made all my images 2. inch Heigh to try it out.
                  And the only image that goes in the center of the cell is the Mailbox  the other images go to the tops of there cells and I see no Black on top of them.

                  Now if all my images are  2. inch heigh  then will they not do the same thing??