Skip to content

Commit

Permalink
Fix table height
Browse files Browse the repository at this point in the history
  • Loading branch information
voodoos committed Aug 28, 2024
1 parent 3679b1b commit d92bac4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
4 changes: 4 additions & 0 deletions vendor/brr_lwd_ui/examples/virtual-table/brr_lwd_ui.css
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ html {
border-left: 1px solid black;
border-bottom: 1px solid black;

:has(> &) {
overflow: hidden;
}

& .lwdui-lazy-table-content,
& .lwdui-lazy-table-content-wrapper,
& .lwdui-virtual-table-row {
Expand Down
13 changes: 12 additions & 1 deletion vendor/brr_lwd_ui/examples/virtual-table/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,21 @@
<title>OCAMIX</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="./brr_lwd_ui.css">
<style>
.flex {
display: flex;
flex-direction: column;
height: 50vh;

}
.flex .table {
flex-grow: 1;
}
</style>
</head>

<body>
<script src="main.bc.js"></script>
</body>

</html>
</html>
7 changes: 5 additions & 2 deletions vendor/brr_lwd_ui/examples/virtual-table/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ let app =
let table = { table; row_height = Em 5. } in
let table = Virtual.make ~ui_table:table data in
Elwd.div
~at:Attrs.O.(v (`P (A (At.style (Jstr.v "height:50vh")))))
[ `R table ]
~at:Attrs.O.(v (`P (C "flex")))
[
`P (El.div [ El.txt' "options" ]);
`R (Elwd.div ~at:Attrs.O.(v (`P (C "table"))) [ `R table ]);
]

let _ =
let on_load _ =
Expand Down

0 comments on commit d92bac4

Please sign in to comment.