Dear Ivan,
Thanks for posting the thread on our forum.
As you are using the task list app in SharePoint Online, the type of the list is showed in the classic view by default and it will show the incorrect values on the list page when you change the classic experience to the modern experience in SharePoint Online.
As a workaround, you can create a normal list and add the same columns as the task list in your environment and then the normal list will be opened in the modern SharePoint experience by default. Then you can use the out-of-the-box way to adjust the column width.
If you want to stay with the task list, you may use the CSS code to adjust the column width. To insert the CSS code, you need to contact the administrator to run Set-SPOsite <SiteURL> -DenyAddAndCustomizePages 0 in SharePoint Online Management Shell on the site to let you use the Script Editor web part. Then you can add the following example code in the web part to see the result.
<style>
.ms-vh-div[DisplayName='Task Name']
{
width : 100px !important;
}
.ms-vh-div[DisplayName='Due Date']
{
width : 100px !important;
}
.ms-vh-div[DisplayName='Assigned To']
{
width : 100px !important;
}
</style>
Before inserting the code.
After inserting the code.
You can change the code values based on your requirements to see the result.
Best Regards,
Cliff