Set the width of a column using table td:nth-of-type()

Let's assume that you are working with the following table:

<div className = 'Table'>

Let's assume that you want to set the width of the first column to 200px:

.Table td:nth-of-type(1),
.Table th:nth-of-type(1){
    width: 200px;

Important: you should modify both td and th width. Otherwise, the width will remain constant.

Hi, I'm Erik, an engineer from Barcelona. If you like the post or have any comments, say hi.