Use DIV to create a table cell : div table « Tags « HTML / CSS






Use DIV to create a table cell

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <style type="text/css">
            html {
                display: table;
                border-spacing: 5px;
            }
            body {
                display: table-row;
            }
            div {
                display: table-cell;
                padding: 5px;
                border: thin solid black;
            }
        </style>
        <title> HTML display property  </title>
    </head>
    <body>
        <div> table cell </div>
        <div> table cell </div>
    </body>
</html>

 








Related examples in the same category

1.Create DIV to create a table
2.A table but pure css
3.CSS table
4.Gallary layout
5.Use div to create a table layout