TRomesh
TRomesh

Reputation: 4481

How to set height to a React Component

I've tried almost everything to set height to a react components but it doesn't seem to be working,but when I set width in the same manner it works! I'm using <card> from Material-ui.

Here is an example:

const Sty1={
height:'100%'
}

const Threads = React.createClass({
render: function() {
return (
  <Card style={Sty1}>
   *other stuff*
   </Card>
     );
   }
});

Upvotes: 1

Views: 22690

Answers (2)

Dipti Bhushetty
Dipti Bhushetty

Reputation: 101

See below:

style={ { height: 100 } } {your parameter to display}</td>

Above is for the column of the table. It keeps the width default, do not change or specify.

Upvotes: 3

hazardous
hazardous

Reputation: 10837

You are trying a relative height which doesn't work on the Card component. Use fixed dimension, or use a Paper.

Upvotes: 1

Related Questions