css display: la tabla no muestra el borde
<html>
<style type="text/css">
.table { display: table;}
.tablerow { display: table-row; border:1px solid black;}
.tablecell { display: table-cell; }
</style>
<div class="table">
<div class="tablerow">
<div class="tablecell">Hello</div>
<div class="tablecell">world</div>
</div>
<div class="tablerow">
<div class="tablecell">foo</div>
<div class="tablecell">bar</div>
</div>
</div>
</html>
Según mi entendimiento, se debe dibujar un borde negro en cada una de las filas que he especificado a través de la clase tablerow. Pero el borde no aparece.
Y quería cambiar la altura de una fila. Si lo especifico con 'px', funciona, pero si le doy un% no funcionará. Intenté lo siguiente
.tablerow {
display: table-row;
border:1px solid black;
position: relative; //not affecting anything and the border disappears!!
//position: absolute; // if this is set,the rows overlaps and the border works
height: 40%; // works only if specified in px and not in %
}
Algo está yendo mal en alguna parte, pero no puedo entender dónde. ¡Por favor ayuda