Skip to content

Commit 4e5189b

Browse files
committed
feat: Adjust anywidget CSS to prevent overflow
The anywidget display was taking up the full width of the container, even when the container was smaller than the widget. This change adjusts the CSS to use `display: inline-block` to ensure that the widget scales to the width of the container.
1 parent 1b25c22 commit 4e5189b

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

bigframes/display/table_widget.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
* limitations under the License.
1515
*/
1616

17+
.bigframes-widget {
18+
display: inline-block;
19+
}
20+
1721
.bigframes-widget .table-container {
1822
max-height: 620px;
1923
overflow: auto;

bigframes/display/table_widget.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ const Event = {
3636
*/
3737
function render({ model, el }) {
3838
// Main container with a unique class for CSS scoping
39-
const container = document.createElement("div");
40-
container.classList.add("bigframes-widget");
39+
el.classList.add("bigframes-widget");
4140

4241
// Structure
4342
const tableContainer = document.createElement("div");
@@ -149,10 +148,8 @@ function render({ model, el }) {
149148
footer.appendChild(paginationContainer);
150149
footer.appendChild(pageSizeContainer);
151150

152-
container.appendChild(tableContainer);
153-
container.appendChild(footer);
154-
155-
el.appendChild(container);
151+
el.appendChild(tableContainer);
152+
el.appendChild(footer);
156153

157154
// Initial render
158155
handleTableHTMLChange();

0 commit comments

Comments
 (0)