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 5 of 5
  1. #1
    Regular Coder
    Join Date
    Oct 2003
    Location
    SC
    Posts
    936
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Align right + Valign top

    if i align my image right it also puts it on the top of the cell but how can i have 50%over the image and 50% under it meaning it is right in the middle of the cell?

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    CSS

    {vertical-align: middle; }
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #3
    Regular Coder
    Join Date
    Oct 2003
    Location
    SC
    Posts
    936
    Thanks
    0
    Thanked 0 Times in 0 Posts
    but this doesnt work in a table cell

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by JAVAEOC
    but this doesnt work in a table cell
    Yes it does.

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html>
    	<head>
    		<title>Testing</title>
    		<style type="text/css">
    			td { border: solid blue 2px; }
    			#row1 { height: 400px; }
    			#row1cell1 { vertical-align: middle; }
    		</style>
    	</head>
    	<body>
    		<table id="myTable" summary="">
    			<tr id="row1">
    				<td id="row1cell1">
    					<img src="sample.gif" alt="" />
    				</td>
    				<td id="row1cell2">
    					Just some text
    				</td>
    			</tr>
    			<tr id="row2">
    				<td id="row2cell1">
    					more text
    				</td>
    				<td id="row2cell2">
    					and the last bit of text
    				</td>
    			</tr>
    		</table>
    	</body>
    </html>
    Tested in IE 6 and Moz 1.4 - worked in both.
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #5
    Regular Coder
    Join Date
    Oct 2003
    Location
    SC
    Posts
    936
    Thanks
    0
    Thanked 0 Times in 0 Posts
    oh i put the valign tag on the image
    doh


  •  

    Posting Permissions

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