View Full Version : Align right + Valign top

02-03-2004, 06:50 PM
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?

Roy Sinclair
02-03-2004, 07:45 PM

{vertical-align: middle; }

02-03-2004, 11:29 PM
but this doesnt work in a table cell :(

Roy Sinclair
02-04-2004, 04:10 PM
Originally posted by JAVAEOC
but this doesnt work in a table cell :(

Yes it does.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<style type="text/css">
td { border: solid blue 2px; }
#row1 { height: 400px; }
#row1cell1 { vertical-align: middle; }
<table id="myTable" summary="">
<tr id="row1">
<td id="row1cell1">
<img src="sample.gif" alt="" />
<td id="row1cell2">
Just some text
<tr id="row2">
<td id="row2cell1">
more text
<td id="row2cell2">
and the last bit of text

Tested in IE 6 and Moz 1.4 - worked in both.

02-04-2004, 11:07 PM
oh i put the valign tag on the image :)