title: Control width of react-data-table-component columns
body: <p>I need to control the widths of the table columns from &quot;react-data-table-component&quot;. So far I am using this but it doesn't work.</p>
  <pre><code>const columns = [
  {
    name: &quot;ID&quot;,
    selector: &quot;id&quot;,
    sortable: true,
    headerStyle: (selector, id) =&gt; {
      return { width: &quot;80px&quot;, textAlign: &quot;center&quot; };
    },
  },
  {
    name: &quot;Another column&quot;,
    selector: &quot;blahblah&quot;,
    sortable: true,
  },]
  </code></pre>
  <p>This is the component -&gt; <a href="https://www.npmjs.com/package/react-data-table-component" rel="nofollow noreferrer">https://www.npmjs.com/package/react-data-table-component</a></p>
  <p><a href="https://i.stack.imgur.com/2fItu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2fItu.png" alt="enter image description here" /></a></p>