So I have a table where the number of rows depends on how much data user wants to extract from backend.
In the layout
I have set the height to document.documentElement.clientHeight * 0.8
and now it statically takes 80% of the screen. If the table itself is larger than it scrolls internally.
I want to avoid the scrolling by setting its height to 100% - how can I do that?
One way around is to set document.documentElement.clientHeight * 2.5
so that it always has enough space, but that is ugly and not dynamic at all.
The code for component:
<Plot
data={[
{
type: "table",
columnwidth: [4, 1],
header: {
values: headerValues,
font: { size: 24, family: "Montserrat" },
height: 50,
align: ["center", "center"],
fill: { color: "rgb(179, 180, 180);" }
},
cells: {
values: cellValues,
align: ["left", "center"],
font: { size: 24, family: "Montserrat" },
height: 50,
fill: { color: [tableColors] }
}
}
]}
layout={{
hoverlabel: { bgcolor: "salmon" },
width: document.documentElement.clientWidth * 0.8,
height: document.documentElement.clientHeight * 2.5,
/*responsive: true,
autosize: true,
legend: {
orientation: "v",
traceorder: "normal"
},*/
title: title,
font: {
family: "Montserrat",
size: 20
},
paper_bgcolor: "#eaeaea",
opacity: 0.01,
plot_bgcolor: "#eaeaea"
}}
/>