diff --git a/bricks/css/bricks.css b/bricks/css/bricks.css index 74e4fbc..9d8a10f 100755 --- a/bricks/css/bricks.css +++ b/bricks/css/bricks.css @@ -356,16 +356,22 @@ body { overflow: auto; } .tabular-header-row { - background-color: #dddddd; - position: sticky; + display: flex; top: 0; + position: sticky; + background-color: #dddddd; + min-width: 0; + min-width: fit-content; flex-wrap: nowrap; flex-shrink: 0; } .tabular-row { + display: flex; + margin-bottom: 5px; + min-width: 0; + min-width: fit-content; flex-wrap: nowrap; flex-shrink: 0; - margin-bottom: 5px; } .tabular-row:nth-child(odd) { background-color: #5dfdfd; @@ -374,7 +380,7 @@ body { background-color: #f9f9f9; } .tabular-row-selected { - background-color: #ef0000; + color: #ef0000; } .tabular-row-content { padding: 2; diff --git a/bricks/tabular.js b/bricks/tabular.js index de8df4b..0c812da 100644 --- a/bricks/tabular.js +++ b/bricks/tabular.js @@ -26,7 +26,6 @@ bricks.Tabular = class extends bricks.DataViewer { return r; } var row = new bricks.VBox({ - css:'tabular-row' }); row.add_widget(r); var content = new bricks.VBox({ @@ -97,6 +96,7 @@ bricks.Tabular = class extends bricks.DataViewer { header = false; } var dr = new bricks.DataRow(options); + dr.set_css('tabular-row'); dr.render(header); dr.event_names.forEach(e => { dr.toolbar_w.bind(e, this.record_event_handle.bind(this, e, record, dr));