Fixed Width (position:fixed) -- Fluid Width (scrollable) -- Fixed Width (scrollable) - layout

Alright, I have this issue, but whenever I want to search "fixed-fluid-fixed" it brings back fixed width on the first column, not position fixed.
How do I get a 3 column layout that is like this:
https://dl.dropbox.com/u/1331627/layout.jpg
Everything I've seen has floats on everything, but that seems to screw up the fixed position menu on the right.
I'd like to have the images scale by themselves and have a fixed width 3rd column. The 2nd and 3rd columns scroll together.
Stumped.

Related

Spacing in Material UI grid not working as expected

Here is my Sandbox for this question: https://codesandbox.io/s/gridspacing-x2fy3?file=/src/Home.jsx
The layout is almost looking how I want it to; however, I would like to be able to adjust spacing between the components within the inner column Grid. Right now, even though I put spacing={4} on line 45 in Home.jsx, it makes no difference whatsoever if I take that line out or replace the value with some number other than 4. I expected the spacing between the components in that Grid to change dependent on that value.
What am I doing wrong and how should I fix it to be able to adjust spacing? Thank you.

Add padding to row heights in XLSX with Apache POI

I have some code that outputs an excel file using POI and I want to have it so that my Row heights have a bit more space than the automatic heights that get set if I do nothing.
Currently i get a row using sheet.createRow(rowNumber) and then I don't set the height at all, and excel / POI just seems to take care of that.
I now want to add a buffer to the automatically set heights, (say 20px) but I cant see a way to do this, when I add my cells it doesn't seem to actually set the height property of the row automatically, so I can't do row.setHeight(row.getHeight()+20) because getHeight just returns the default height, and so all my Rows end up the same height, instead of the auto height + 20.
Similarly if i set the Default height of the sheet it doesn't bother automatically working out heights for anything that needs to be bigger than the default.
Is there a way to do this?
Actually you're using the right API but as Axel Ritcher pointed out, there is no concept of padding for a cell. The only problem is that 20 is such a tiny value that you can't see any notable difference. You can try something like:
row.setHeight((short)(row.getHeight() * 2));

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.

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