question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Data table doesn't shrink when window is resized

See original GitHub issue

I’m submitting a … (check one with “x”)

[ x ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter

Current behavior When rendering the datatable in a view and not absolutely positioned, the initial width is set and making the window larger triggers a resize, but shrinking it does not.

Expected behavior It would re-render the width for enlarging and shrinking window.

Reproduction of the problem I’ll try to get a plunker up but it’s entirely possible that there something else causing this that is specific to my app.

What is the motivation / use case for changing the behavior?

Please tell us about your environment: Mac, Chrome latest, Webstorm

  • Table version: 0.8.x Latest

  • Angular version: 2.0.x 4.4

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ] Chrome

  • Language: [all | TypeScript X.X | ES6/7 | ES5]

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:18
  • Comments:18

github_iconTop GitHub Comments

4reactions
Tecmeshcommented, Jun 30, 2020

I Think i solved the hard way. Just add these Lines in your CSS Rules :

.datatable-header {
    min-width: 100%;
}

.datatable-body {
    min-width: 100%;
}

This will keep the header and body of the table on a good shape. I recommend to wrap the datatable on a div using the .table-responsive class from bootstrap. it will work better for responsive.

4reactions
sudha1981commented, Dec 28, 2018

Invoke the below method on sidebar minimizer

(click)=“WindowResize($event)”

WindowResize(e) {
setTimeout(() => { window.dispatchEvent(new Event(‘resize’)); }, 250); }

Read more comments on GitHub >

github_iconTop Results From Across the Web

Columns don't resize on window resize unless scrollX is true
My small issue: in my table, the columns don't resize when the window size is changed, unless scrollX is set to true ....
Read more >
dataTables not resizing properly when changing window size ...
In my web page I have a navigation tab bar with two tabs. Each tab has a separate data table.
Read more >
Resize table rows and columns in Pages on Mac
Click the table. ... , then drag to resize. ... , then drag to resize. They're resized proportionally. Resize all rows or columns...
Read more >
Sizing and Resizing of DataTable, Configuration Webix Docs
The width and height of a datatable must be set through number values. The usage of string values is incorrect and will cause...
Read more >
Resize a table, column, or row - Microsoft Support
To adjust table width automatically, click AutoFit Window. Note: Row height automatically adjusts to the size of the content until you manually change...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found