Set the max-height element in the html table

advertisements

I realise that this question has probably been asked to death, but none of the answers I have found seem to work. I have an ASP repeater control, in which I have set the ItemTemplate to have a simple table with two rows.

When populating the rows, I want the rows to stay the height I have set them, not grow to the size of the content.

I have tried setting style="max-height:100px; overflow:auto"; on the table, table row and table data which did not do a thing.

How do I ensure that my repeater template are always the same height, not the height of their content?


Make sure you are applying those CSS properties (particularly overflow:hidden) to the repeating parent block element. Doing it to a child element will not be helpful if the parent is expanded and doing it to an inline element will not affect it because inline elements necessarily use the size of their contents.