Tabulator : Stretch Last Row - tabulator

In Tabulator there is an option for the columns to "Fit Columns to Data and Stretch Last Column".
I would like a similar behaviour for rows, the last row stretching to fit the table and fill the height.
The height and data in my table are dynamic so my desired behaviour:
if there are more rows than can fit in the parent div show scroll bars
if the height of the parent div is more than the number of rows, then stretch the last one
Is this possible?

This is not an available option in Tabulator, and i would argue it would make for terrible UI as stretching the row could lead to all sorts of unpleasant side effects depending on the formatter you are using.
There are two more visually appealing options that may work
Background colour
It would be far better to change the background colour of the table to match the row colour so that you still achieve that full table look without stretching a row:
.tabulator{
background-color:#fff;
}
Max Height
If you are concered about too much whitespace in the table, then instead of defining a table height, you could define the maxHeight, that way the table would scroll when there was enough rows and shrink when there aren't.
var table = new Tabulator("#example-table", {
maxHeight:300, //maximum height for the table is 300px
});

Related

Shrink table to fit columns?

I have a table with all fixed width columns. The problem is the table expands to the width of the container, while the columns are justified against the left hand edge. The table is a lot wider than just the columns by themselves. Is it possible to shrink the table width to just the width of the columns or am I making a feature request?
If your columns have a fixed width, you should know the width your table needs to be... You can set the width in CSS or with a style tag in your html. So 8 x 50px columns needs a table width of 400px:
<div id="example-table" style="width:400px"></div>
or in CSS
#example-table{
width:400px;
}
Sorry if I've misunderstood the question (I can't comment to clarify).

Masonry: Fit Width but maintain maximum container size?

Per the example in the Masonry documentation, http://masonry.desandro.com/options.html, I centre my Masonry layout by setting isFitWidth = true, and setting {margin: 0 auto} on the Masonry container.
When I have loads of items to display this is a really nice solution. For example, let's say my viewport is just over 5 columns wide, I will see all the items laid out, 5 to a row, and the whole container centred within my viewport. Lovely.
The problem arises when I have less than 5 items. In this case, the container remains centred in the viewport, but it shrinks to fit the number of items. So if I have, for example, two items, I will have two columns in the middle of the screen, with one item each.
What I would like to see is the container maintain is size (in this example, 5 columns), and remain centred, and lay the content out LTR (in my case).
I have experimented with media queries and setting a minimum width for the container based on the viewport. This looks like it will work, but it's messy - I don't fancy having to update the media queries (including recalculating all the gross container widths) each time my column size changes. (I'm sure users will want some changes).
Another solution might be to add some fake items to the content and set their visibility to hidden, but this is not exactly elegant either.
Is there a more simple solution that I'm missing?
One additional point - I am stamping some items in place too, top left and top right. I don't think this should affect any solutions.
OK, So the only way I could find to do this effectively was to use media queries. I setup a spreadsheet to help recalculate things when I changed column and gutter sizes. Here's the variables and equations, in case they are helpful:
If:
WC = Width of column
WG = Width of gutter
N = Number of columns
CON = Width of container
Then:
CON = N*WC + (N-1)*WG
You can set up a spreadsheet and experiment with WC and WG, and a range of N=1...10 This will give you the size of CON for each value of N. The width of the viewport needs to be CON plus any horizontal margin and padding on CON (or its parent).
To set media queries I took the approach that the container should be as wide as possible, but still neatly accommodate exact columns. So, for example, if the viewport can accommodate 5 columns, (but not quite 6), I set the corresponding min-width on CON. This leave the container neatly centred.
By way of example, here is one of my media queries:
#media (min-width: 996px) and (max-width: 1361px) { .content-container { min-width: 966px; } }
I hope this is helpful to someone. I'll leave the question open for a few days in case there are other solutions forthcoming.

Susy: fluid columns with fixed gutters?

I'm trying to build a 12 column grid with fluid columns and fixed gutters. Columns would change width as the window resizes, but the gutters would remain constant. Basically, percentage for columns, ems for gutters.
Is this possible with Susy?
You could use the padding as your gutter and would allow you to have a fixed "spacing" while keeping the fluid nature of the grid.
This would however force you to add extra markup if you need backgrounds that doesnt extend to the "gutter" area.

Excel: Stretching a graph on x axis

In my graph, the x axis are text values. When I make the graph, I cannot stretch it to the whole width. Instead, it takes only less than half of the width.
I usually do this by clicking on "Format Axis", but it doesn't offer that in this case.
Here is the screenshot:
I'm using Excel for Mac.
When you made the chart, did you select a bunch of empty rows below the range that actually contains data? Looks like twice as much empty data as data with values.
If you select the plot area or chart area, you can see the source data of the chart highlighted in the sheet. You can resize the highlighted range with the mouse to modify the amount of data in the chart.
Did they made different types for windows and mac? I'm using windows and scaling is never a problem here.
I can't give you any answer but I can give you a suggestion. Can you check the width of the numbers below the 'Number of public SLA templates' label? Its occupying all the width of your window.

Remove the scroll bar on a list box

I'm using a userForm in vba and I have a list box. I want to remove the horoz. scroll bar from the bottom. Is there a way to do this? I don't see any option in the properties box.
This can occur when you have the column width format property of the listbox set to something wide, then you size the control to the data, it will show the scroll bars.
To fix this, change the "Column Width" property under the format tab to something really small, then play around with this property and the size of the listbox control until you get it how you want, and no scroll bars are displayed.
You need to set the property ListWidth of the listbox or combobox bigger than the property ColumnWidth.
The first being the size of what you show on screen,
and the second being the size of what you want to put inside the first.
As mentioned in other replies, this is a combination of the ColumnWidth and the Width. The main players are
ColumnCount: Listboxes allow the data to snake through multiple columns but that is a different story. For the simple case, set the Column Count to 1
Width: This is set by stretching the drawing
ColumnWidths: This will set the widths of the columns. In the simple case, find out what Width has been set to and subtract the scrollbar width from that value. By default, the Column Width is set to the Width. Since in also includes the size of the vertical scrollbar. The horizontal scrollbar appears if
((sum of columnwidths) + vertical scrollbar width) > (width / column count)
In the simple case, there is only one column width and only one column so the horizontal scrollbar will appear if
(columnwidths + vertical scrollbar width) > width
To find out the scrollbar width, drag a scrollbar on to the canvas. Scroll to the bottom of the properties and find the width. In my case it is 12.75 - make it 12 to simplify the arithmetic.
Worked Example:
Column Count = 1
Width = 48pt
Column Widths = 48 - 12 = 36pt
Try making the listbox a little wider.... not mucn wider, but just enough to get rid of the horizontal scroll bar.
Maybe that will work.
Click on the Userform. Under the Property Stats, look for KeepScrollBarsVisible.
Change it to 0 - fmScrollBarsNone
I was working with this for two hours - trying to find the answer in the ListBox. It is NOT there!
Jim
I declared columnwidth in start of form and it works like a charm!
The technique that actually worked for me was to set ColumnWidths property in section Data to a smaller number than the property Width in Position section. In the image below I set 30pt size on ColumnWidths which is smaller than number 40 in property Width. Please find an image showing both properties. I hope this helps.

Resources