Yusril Maulidan Raji
Yusril Maulidan Raji

Reputation: 1932

How to make the height of rows fixed?

I have a table with a column that contains random size of image. Because of this image column, it changes the height of each row.

Therefore, Is there any option to fix the height of all rows?

Here is the demo: http://live.datatables.net/wisalaru/1/edit

If there is no such an option like so, is there any other solution for that?

Upvotes: 0

Views: 45

Answers (2)

William Groenendijk
William Groenendijk

Reputation: 1

The easiest way is perhaps to fix the height of the image itself. The images will scale down (or up, if they're smaller).

If, for example, you set tbody img { height: 40px; } then a tr will only exceed 40px when other content in the same row causes it to be.

Upvotes: 0

Ashwin K Joseph
Ashwin K Joseph

Reputation: 391

Just give a fixed height in the style attribute as well as proper overflow values. Then add the img-responsive class of bootstrap to the image

Upvotes: 1

Related Questions