Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    Regular Coder
    Join Date
    Dec 2007
    Posts
    269
    Thanks
    28
    Thanked 0 Times in 0 Posts

    cantre table as vertically

    Suppose that my table is like following

    Code:
    <table  id="table1" width="100%" border="0" cellspacing="1" cellpadding="0">
      <tr>
        <td>	
    	  <table  id="table2" width="100%" border="0" cellspacing="1" cellpadding="0">
            <tr>
              <td>&nbsp;</td>
            </tr>
          </table></td>
        <td>	
    	</td>
      </tr>
    </table>
    when i write a long text inside right part table in left is center vertically but i want it is top always (see link)




    http://img216.imageshack.us/my.php?image=snap1su1.gif

  • #2
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    What we need to see is the CSS code that is associated with the table.

    Otherwise you have to use this CSS with the td

    Code:
    #table1 td{
    vertical-align: top;
    }
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.

  • #3
    Regular Coder
    Join Date
    Dec 2007
    Posts
    269
    Thanks
    28
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by jeremywilken View Post
    What we need to see is the CSS code that is associated with the table.

    Otherwise you have to use this CSS with the td

    Code:
    #table1 td{
    vertical-align: top;
    }
    it did not run. it is still in center

  • #4
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    Well what is the code for your page? Which one do you want to be top?

    Also, using tables for layout is bad, so perhaps there is a better method if we can see the whole code.
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.

  • #5
    Regular Coder
    Join Date
    Dec 2007
    Posts
    269
    Thanks
    28
    Thanked 0 Times in 0 Posts
    Code:
    <table  id="table1" width="100%" border="0" cellspacing="1" cellpadding="0">
      <tr>
        <td>	
    	<!--table i want to center vertically-->
    		  <table  id="table2" width="100%" border="0" cellspacing="1" cellpadding="0">
    			<tr>
    			  <td>&nbsp;</td>
    			</tr>
    		  </table>
    	<!--table i want to center vertically-->
    	  </td>
        <td>	</td>
      </tr>
    </table>

  • #6
    Senior Coder twodayslate's Avatar
    Join Date
    Mar 2007
    Location
    VA
    Posts
    1,042
    Thanks
    67
    Thanked 39 Times in 39 Posts
    twitter | Quality Hosting - $5.95/mo*
    Feel free to PM me!

  • #7
    Regular Coder
    Join Date
    Dec 2007
    Posts
    269
    Thanks
    28
    Thanked 0 Times in 0 Posts
    i can not do it would you give me a sample ?

  • #8
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    That is a sample...that doesn't use tables for layout. Which is not good to do by the way.
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.

  • #9
    Regular Coder
    Join Date
    May 2008
    Location
    Lost in Localhost...
    Posts
    702
    Thanks
    3
    Thanked 43 Times in 42 Posts
    Quote Originally Posted by jeremywilken View Post
    That is a sample...that doesn't use tables for layout. Which is not good to do by the way.
    Agreed. It's time to visit my favorite link.


  •  

    Posting Permissions

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