I am using primeng with angular, However, it feels like my problem is with html/css.
I have found out how to present my ui the way I would like with the datatable component. However, when I leverage the datatable component inside the rowexpansion feature my column widths are not adhered to.
You will see that in the below table inside a table the column width is 100px. The parent table has it correctly set to 100px.
Here is the entry code entry
Here is where the width of the columns are set
Specifically the code that I debugged is below
for(let i = 0; i < columns.length; i++) {
columns[i].style.width = columns[i].offsetWidth + 'px';
}
The offsetWidth
is different for the parent then the child even though I am setting the style the same way for both tables.
My conclusion thus far is that offsetWidth
is calculated differently when my table is inside a div
vs inside of a td
.
I looked at the default css for each HTML element and tried to make them match. However, it must be displayed as a table-cell
because it requires the colspan
attribute otherwise the row won't span the table as intended.
I have looked at a number of websites to determine how offsetWidth
is calculated but nothing has stood out to me. So I am going to the SO community to see if there is a bug in the browser (Chrome) or if there is a css property I can use to make it behave the same way.