Click here to Skip to main content
15,892,927 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys... I would like to ask why is it that the property table-cell is not working properly and not aligning vertically in the middle?
right now i have this structure and i want the images for this structure to be align center... it working in other browser properly but when it comes to ie its not working here is the structure for my html...
<div id="logos">
   <ul>
      <li><img src="image1.jpg" /></li>
      <li><img src="image2.jpg" /></li>
   </ul>

</div>


so i want the images to be vertically aligned in the middle (assuming image2 has a bigger height than image1. assuming image2 has a height of 100px and image2 has a height of 40px)

and here is my css styling for this

#logos ul{
  display: table;
  height: 100px;
  margin: 0;
  padding: 0;
  text-align: center;
}
#logos ul li{
  display: table-cell;
  list-style: none outside none;
  padding-right: 15px;
  text-align: center;
  vertical-align: middle;

}

i tested this on other browser other than IE and its working but im so frustrated when it comes to IE... i cant seem to make table-cell property work properly... any help will be great guys... thanks
Posted

1 solution

Since you know the size of the table (700) you can work around the bug by setting the width of both cells in the second row. With the second cell set to 600 px, the table behaves.

However, this is probably a spec bug, since it all seems very vague about many details. The algorithm in CSS 3 looks much more carefully specified.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900