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.

Adjust table dynamically until fixed size

See original GitHub issue

i have a basic table

<table id="table" data-search="true" data-show-columns="true" data-pagination="true" data-height="250">
...
</table>

when we put a value for height, table seem to take this space as if there is only element…

Is it possible to take all the height only when there are enough element in the table?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
sqivacommented, May 18, 2017

@fanshaoer

http://jsfiddle.net/dndph7c3/1/

You can dynamically set the height using that function. You can check if the height is greater using get height or count the data and dynamically set the height.

1reaction
nysmooncommented, Aug 14, 2017

@xyluet here is your updated fiddle http://jsfiddle.net/dhvddove/1/

Adding these CSS styles solved it:

.fixed-table-container {
	border: none;
	height: auto !important;
}

.fixed-table-body {
	max-height: 400px; 
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Fit table that has dynamic size inside div with fixed size
I have a square table whos size changes dynamically(For example, 2*2/3*3/4*4). I want to fix this dynamically changing table inside a div ...
Read more >
list manipulation - Dynamically change the size of table
Dynamically change the size of table · Just create a new matrix every time instead of put the new data into a fixed...
Read more >
I want to adjust the width of the dynamic columns to a fixed size
Hi I have a table which is growing dynamically depending upon the data that is coming from the objects. Here i have a...
Read more >
How to set fixed width for <td> in a table ? - GeeksforGeeks
Using width attribute: The <td> tag has width attribute to control the width of a particular column. By assigning a numeric value to...
Read more >
table-layout - CSS: Cascading Style Sheets - MDN Web Docs
Table and column widths are set by the widths of table and col elements or by the width of the first row of...
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