intelis
intelis

Reputation: 8068

Why isn't the max-height working on table?

Can someone please explain to me why the max-height is not working on table element?

Here is the code

Upvotes: 6

Views: 5689

Answers (3)

Solid1Snake1
Solid1Snake1

Reputation: 272

You need to specify the display. Try display: block;

Upvotes: 0

Tariqulazam
Tariqulazam

Reputation: 4585

You have to wrap the table within a DIV to make the max-height working. As bookcasey mentioned max-height for table is undefined in the specification.

Upvotes: 0

bookcasey
bookcasey

Reputation: 40511

In CSS 2.1, the effect of 'min-height' and 'max-height' on tables, inline tables, table cells, table rows, and row groups is undefined.

Read the spec.

Set the table to display: block if you want to force max-height.

Upvotes: 10

Related Questions