How to adjust width of the th as per the td width using css : <p>I have a table using <code>display:block</code> for <code>thead</code> and <code>tbody</code>. if the data in <code>&lt;td&gt;</code> increases, the <code>&lt;th&gt;</code> also needs to increase the width but now it won't works like that....Because of <code>display:block</code> ...How to fix this? any suggestions please!</p>

<p>Here I have tried css:</p>

<pre><code>table thead,table tbody {
    display: block;
}

table tbody {
    overflow-x: hidden;
    overflow-y: scroll;
    min-height: 90px;
    max-height: 300px;
}

td, th {
    width: auto;
}
</code></pre>
