What size in cells is A4? - google-sheets

I'm trying to create a Google Sheets template that is exactly A4. The reason for that is I need to insert a picture in there that is absolutely placed and sized.
So, I'm figuring that since A4 is 210x297mm and Google Sheets default resolution is 96dpi, I need 793.59x1122.363 pixels.
Since a cell is 100x21 pixels, I need 7 cells horizontally + an additional cell that is 93 pixels large and 53 cells vertically + a cell that is 9 pixels high.
Which prints too big (A4, portrait, Scale Normal 100%, Margins 0,0,0,0):
too big
If I manually adjust the size of the cells to get a complete grey area without white lines on a single page, like this:
perfect size
I need 7 cells + one cell that is 85 px large x 53 cells + one cell that is 8 px high.
Note that (53*21+8)/785 = 1.428, which is not sqrt(2), the standard A4 ratio.
Why ? Thanks!

Related

WKInterfaceGroup spacing not perfectly 0 sometimes (WatchKit)

I set up a group in my WatchApp Storyboard which has a width relative to container 1 and height relative to container 0.5.
Inside this group I have 20 horizontal aligned groups with a width relative to container 0,05. The spacing of the group is set to 0 but when i set a background color to all groups I end up like this.
As you can see, some spacings are really zero but sometimes there is a small gap of about 1 px. Is this some sort of bug? Is it possibile to perfectly align the groups so that it looks like it is one solid background?
Please don't tell me, that I can set the background color of the first group. Obviously I know that, i need it to work like this!
Thanks!
I believe the problem is that the width of the screen isn't evenly divisible by 20. The width of the 42mm screen is 312 pixels, which divided by 20 is 15.6 pixels. Apple is probably truncating this to an integer value for performance, which results in the gaps.
I reproduced your problem and then, to test my theory, I created 8 groups instead of 20 and set them to a width of 0.125. This resulted in no gaps, which makes sense since 312 is divisible by 8.
The 32mm watch has a width of 272 pixels and, doing factorization of the two I got:
272 = 2 * 2 * 2 * 2 * 17
312 = 2 * 2 * 2 * 3 * 13
Which shows that eight columns is the maximum by which you can evenly divide both sizes.
If you have to have 20 columns, then I would set each to a fixed width, some at 15 and some at 16 pixels for the 42 mm, and 13/14 pixels for the 32 mm to get the layout you want.

JIRA 5 logo size issue

In JIRA 5
Administration -> System -> User Interface -> Look And Feel
when I changing logo with image size 57x30px (width/height)
Text from page: "The height of the logo image will be constrained to a maximum of 30 px.
Also, it is recommended to use an image with a 57 px width."
its displayed on jira page with size 187x40px (width/height) and looks very blurry.
How can I fix this? (disable logo stretches)
For those interested in Jira 6.4 and confluence 5.8...
In JIRA, the image size you want (without scaling) will be 30px tall. Any image height taller than 30 will be scaled to 30. JIRA automatically puts padding on your image 5 top 5 bottom...for total of 40 pixels high. JIRA will allow you to do an image wider than 57...it pushes the menu over..at least in the default theme.
In Confluence, for some reason the authors decided 5 pixels was not enough padding. So, they added 3 more. Top and bottom. For a total of 16 pixels of padding.
Yes, the confluence tag line below the image upload says, "limit to 48 pixels tall", but this is a lie. if you make it 48px tall, it will be scaled to 24 px tall. Then the 16 pixels of padding is added for a total hight of 40px.
I will be checking on Stash/Bamboo in the future.

How to calculate the size of cell in UITableView when using grouped style?

I'm working on a universal app and the view I'm working on is common to iPhone and iPad.
I display a UITableView (with grouped style) and I made a custom cell (programmatically - no nib). I read somewhere (can't find where anymore) that the margins are of 1/16 * width of the table. So I set the width of my custom cell to 14/16 * width of the table but that's not good. Or at least it doesn't work well.
Can someone confirm or invalidate that the margins are 1/16 * width of the table?
And in the case that's not 1/16, how can compute that size?
iPhone portrait margins : 10 pixels
iPhone landscape or iPad margins:
- if table width<400 then 10 pixels
- else margin = 6% of table width, with minimum of 31 pixels, max of 45 pixels
I believe the default horizontal margin is 10 pixels. But you could use auto resizing, eg UIViewAutoresizingFlexibleWidth. Look at the UIView documentation.

What components make up a UITableView?

I am trying to resize a grouped tableview 'tv', knowing that a new section (with a single row) is going to be added.
I thought that I could increase the height using:
newHeight = tv.frame.size.height + tv.rowHeight + tv.sectionFooterHeight + tv.sectionHeaderHeight;
but this seems to be too little (by about 30 pixels using default heights).
Am I missing some other part of the tableview? Maybe some buffer space between elements?
tv.sectionHeaderHeight and sectionFooterHeight both report a height of 10 - this seems fishy to me since the header looks at least twice the size of the footer.

How high is the spacing between UITableViewCell?

Anybody know how big is the spacing between UITableViewCells in points ? That is I would like to know whether there are any screen spaces allocated between cells in an UITableView and how high are they, in each of these separator styles:
UITableViewCellSeparatorStyleNone – is it 0pt ?
UITableViewCellSeparatorStyleSingleLine – is it 1pt?
UITableViewCellSeparatorStyleSingleLineEtched – is it 1pt or 2pt?
The problem I'm currently facing is that I have a variable-height cells and I need to calculate how high a group of cells may be. Currently I'm using UITableViewCellSeparatorStyleSingleLine separator style and assuming that the inter-cell spacing is 1pt high but my calculations are often off.
That is, supposed that there are three cells, each 40 pt high, my assumption is that the total height will be 40 + 1 + 40 + 1 + 40 = 122 points high.
Questions are:
Is it true that a single line separator takes 1pt height between the cells?
If not, what is the height of the separator line, if any space is allocated at all (i.e. doesn't "eat" into the adjacent cell's space.
Thanks in advance.
This is a problem you can solve very easily by taking a screenshot from interface builder and then measuring it in Photoshop, however I've saved you the trouble:
The separator is not added to the the height of the table cell - it is drawn in front of the cell, so if your table cell height is 44 (the default) then the combined height of two cells will be 88, regardless of which separator style you choose.

Resources