table max-height 100% de div posición fija

Tengo un div:

position: fixed;
top: 100px;
bottom: 0px;
left: 0px;
right: 0px;

and inside this div is a table:

height: 100%;
max-height: 100%;

and when table cells gets some data, table grows down, but always not bigger than div container. This work well but not in Firefox 13, table grows down to bigger than fixed positioned container.

¿Cómo puedo arreglarlo?

preguntado el 04 de julio de 12 a las 10:07

try removing Max-height:100% because having both does not make much sence -

both cases dont work, with or without ive tried. -

Percentual values of the height selector does not work by default. The parent div must have a height value assigned first. -

What if parent height depends on window height as in example above. -

2 Respuestas

You can't. A table's dimensions are rigid. The content of the cells can never break through it. This means that it will, whether you like it or not, grow in width and/or height, and will ignore your CSS rules if needed.

¿La solución? Usar overflow: auto; or overflow: scroll; en el contenedor div, so it adds scrollbars as necessary.

Respondido 04 Jul 12, 17:07

Add this line to your "div css" and it will fix all your problems: overflow: auto;

overflow: auto; will add vertical or horizontal scrollbars as needed while overflow: scroll; will add both regardless and disable (but still remain visible) the one that's not in use.

Respondido 05 Jul 12, 17:07

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.