Search code examples
c#cssasp.net-coreblazormudblazor

MudTable ColGroup not working when having more than 10 columns


I used a MudTable to display data with 14 columns. I tried to set the width for some columns but none of them worked. I tried to comment on a few columns, and limit them to 4 columns and it worked.

    <ColGroup>
        <col style="width: 60px;" />
        <col />
        <col />
        <col style="width: 100px;"/>
    </ColGroup>

I am not sure MudTable has any attribute affecting the ColGroup. How to set a specific width if you have more than 10 columns in a MudTable?

Update: I tried to set the width to max-content in the browser and it displayed correctly. However, when I set it in the code, the height gets out of the screen and scrollbars disappeared.


Solution

  • I had to create a div or span nested in and set the width to that div for it to work. Problem solved.