CSS Property Value How to - display: table-cell;








Question

We would like to know how to display: table-cell;.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
div {<!--from  w ww.j a  v a2 s  .c o m-->
  display: table-cell;
  vertical-align: middle;
  border: 1px dotted gray;
  height: 200px;
}
</style>
</head>
<body>
  <div>
    <p>First paragraph.</p>
    <p>Second paragraph.</p>
  </div>
</body>
</html>

The code above is rendered as follows: