My requirement is want my table layout to be fixed. My problem is When I select value in dropdown box,Table column width dynamically changes according to length of selected value in dropdownbox but I want my MudSimpleTable Layout to be static non changing. I have created snippet link of my problem I am facing. Do anyone know how to fix it?
I Want my MudSimpleTable Layout to be Static-Non Changing
74 Views Asked by Joe At
2
There are 2 best solutions below
0

I Fixed it using Css by adding div tag above MudsimpleTable
<style>
.table-container2 {
overflow-x: auto;
}
.table-container2 table {
table-layout: fixed;
width: 100%;
}
.table-container2 th,
.table-container2 td {
overflow: hidden;
word-wrap: break-word;
white-space: normal;
}
</style>
<div class="table-container2"> <MudSimpleTable..../> </div>
Use static units for max-width on the td for the static column. E.g.
max-width:1px;
the value just needs to be> 0
and you use theColGroup>col
to control the width of the column. e.g.<col style="width:30%;" />
I'd also recommend using the preexisting templates such as
MudTd
,MudTh
.MudBlazor snippet demo