How can I calculate the size of a square block and the number of rows and columns needed to fit a known...

Describing a chess game in a novel

Can a medieval gyroplane be built?

Violin - Can double stops be played when the strings are not next to each other?

Asserting that Atheism and Theism are both faith based positions

Worshiping one God at a time?

What favor did Moody owe Dumbledore?

Existence of a celestial body big enough for early civilization to be thought of as a second moon

Wrapping homogeneous Python objects

Is there a hypothetical scenario that would make Earth uninhabitable for humans, but not for (the majority of) other animals?

What can I do if I am asked to learn different programming languages very frequently?

Print last inputted byte

Do native speakers use "ultima" and "proxima" frequently in spoken English?

Comment Box for Substitution Method of Integrals

Relation between independence and correlation of uniform random variables

Generic TVP tradeoffs?

What are substitutions for coconut in curry?

두음법칙 - When did North and South diverge in pronunciation of initial ㄹ?

Is it true that good novels will automatically sell themselves on Amazon (and so on) and there is no need for one to waste time promoting?

Is it insecure to send a password in a `curl` command?

In what cases must I use 了 and in what cases not?

How is the partial sum of a geometric sequence calculated?

Variable completely messes up echoed string

Deletion of copy-ctor & copy-assignment - public, private or protected?

How can an organ that provides biological immortality be unable to regenerate?



How can I calculate the size of a square block and the number of rows and columns needed to fit a known number of blocks on a page of known size?


Fitting n number of squares into n areaQuestions about interpolating translated points from a gridCalculating the number of tiles shown on an isometric mapHow do continuity, distance and irrationals arise from discreteness?How to effectively distribute points on planeCompressing an image by merging pixelsMaximum square cells in a rectangleA question about $ (2 times 3) $-rectangles.How to divide a rectangle into fewest equally sized nearly-square sub-rectanglesFitting n number of squares into n areaDividing a unit square into rectangles













0












$begingroup$


I am a web developer and have a problem to solve that I thought might be suitable on here...



I am developing an app that will be used on a range of phones and tablets all with different screen sizes. One of the pages of this app will show a grid full of square buttons. The number of buttons to show will change each time the app is used. I want to fill the page as much as possible with the buttons and space them evenly on the page in a grid. The page will always be in landscape format (wider than it is high - sorry to state the obvious).



So my question is this - how can I calculate



1) The size of the square buttons
2) The number of rows
3) The number of columms
4) The distance between each button so they are spaced evenly



given that when the app loads i will know



a) The width of the screen
b) The height of the screen
c) The number of buttons to show



Until the app loads I will not know any of these values.



The number of buttons is likely to be in the region of 60 or so. SO for example if I have 60 buttons to show on an phone with width of 480 pixels and height of 270 pixels, I will show 10 columms and 6 rows, each block will be about 35 pixels square and I will space them out by 10 pixels. My grid will thus be (10*35)+(10*10) = 450 wide and (6*35)+(6*10) = 270 high.










share|cite|improve this question











$endgroup$








  • 1




    $begingroup$
    Whats your question? You have already provided a valid example. btw should the page look like the grid from windows 8?
    $endgroup$
    – Le Chifre
    Mar 17 '13 at 17:18
















0












$begingroup$


I am a web developer and have a problem to solve that I thought might be suitable on here...



I am developing an app that will be used on a range of phones and tablets all with different screen sizes. One of the pages of this app will show a grid full of square buttons. The number of buttons to show will change each time the app is used. I want to fill the page as much as possible with the buttons and space them evenly on the page in a grid. The page will always be in landscape format (wider than it is high - sorry to state the obvious).



So my question is this - how can I calculate



1) The size of the square buttons
2) The number of rows
3) The number of columms
4) The distance between each button so they are spaced evenly



given that when the app loads i will know



a) The width of the screen
b) The height of the screen
c) The number of buttons to show



Until the app loads I will not know any of these values.



The number of buttons is likely to be in the region of 60 or so. SO for example if I have 60 buttons to show on an phone with width of 480 pixels and height of 270 pixels, I will show 10 columms and 6 rows, each block will be about 35 pixels square and I will space them out by 10 pixels. My grid will thus be (10*35)+(10*10) = 450 wide and (6*35)+(6*10) = 270 high.










share|cite|improve this question











$endgroup$








  • 1




    $begingroup$
    Whats your question? You have already provided a valid example. btw should the page look like the grid from windows 8?
    $endgroup$
    – Le Chifre
    Mar 17 '13 at 17:18














0












0








0





$begingroup$


I am a web developer and have a problem to solve that I thought might be suitable on here...



I am developing an app that will be used on a range of phones and tablets all with different screen sizes. One of the pages of this app will show a grid full of square buttons. The number of buttons to show will change each time the app is used. I want to fill the page as much as possible with the buttons and space them evenly on the page in a grid. The page will always be in landscape format (wider than it is high - sorry to state the obvious).



So my question is this - how can I calculate



1) The size of the square buttons
2) The number of rows
3) The number of columms
4) The distance between each button so they are spaced evenly



given that when the app loads i will know



a) The width of the screen
b) The height of the screen
c) The number of buttons to show



Until the app loads I will not know any of these values.



The number of buttons is likely to be in the region of 60 or so. SO for example if I have 60 buttons to show on an phone with width of 480 pixels and height of 270 pixels, I will show 10 columms and 6 rows, each block will be about 35 pixels square and I will space them out by 10 pixels. My grid will thus be (10*35)+(10*10) = 450 wide and (6*35)+(6*10) = 270 high.










share|cite|improve this question











$endgroup$




I am a web developer and have a problem to solve that I thought might be suitable on here...



I am developing an app that will be used on a range of phones and tablets all with different screen sizes. One of the pages of this app will show a grid full of square buttons. The number of buttons to show will change each time the app is used. I want to fill the page as much as possible with the buttons and space them evenly on the page in a grid. The page will always be in landscape format (wider than it is high - sorry to state the obvious).



So my question is this - how can I calculate



1) The size of the square buttons
2) The number of rows
3) The number of columms
4) The distance between each button so they are spaced evenly



given that when the app loads i will know



a) The width of the screen
b) The height of the screen
c) The number of buttons to show



Until the app loads I will not know any of these values.



The number of buttons is likely to be in the region of 60 or so. SO for example if I have 60 buttons to show on an phone with width of 480 pixels and height of 270 pixels, I will show 10 columms and 6 rows, each block will be about 35 pixels square and I will space them out by 10 pixels. My grid will thus be (10*35)+(10*10) = 450 wide and (6*35)+(6*10) = 270 high.







geometry






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Mar 17 '13 at 17:57









Qiaochu Yuan

281k32592938




281k32592938










asked Mar 17 '13 at 16:59









undefinedundefined

1011




1011








  • 1




    $begingroup$
    Whats your question? You have already provided a valid example. btw should the page look like the grid from windows 8?
    $endgroup$
    – Le Chifre
    Mar 17 '13 at 17:18














  • 1




    $begingroup$
    Whats your question? You have already provided a valid example. btw should the page look like the grid from windows 8?
    $endgroup$
    – Le Chifre
    Mar 17 '13 at 17:18








1




1




$begingroup$
Whats your question? You have already provided a valid example. btw should the page look like the grid from windows 8?
$endgroup$
– Le Chifre
Mar 17 '13 at 17:18




$begingroup$
Whats your question? You have already provided a valid example. btw should the page look like the grid from windows 8?
$endgroup$
– Le Chifre
Mar 17 '13 at 17:18










1 Answer
1






active

oldest

votes


















0












$begingroup$

Note that if your grid is $6 times 10$, you only have $5 times 9$ gaps, so the resulting grid is $440 times 260$. Otherwise your work is fine. There is no magic in choosing the size of the square, the size of the gap, and the arrangement. If your grid is $w$ squares wide, $h$ squares high, squares have a side of $s$, and the gap is $g$, the grid will occupy $(ws+(w-1)g) times (hs+(h-1)g)$ pixels. Pick the constants so it looks good to you.






share|cite|improve this answer









$endgroup$













    Your Answer





    StackExchange.ifUsing("editor", function () {
    return StackExchange.using("mathjaxEditing", function () {
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
    });
    });
    }, "mathjax-editing");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "69"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    noCode: true, onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f332939%2fhow-can-i-calculate-the-size-of-a-square-block-and-the-number-of-rows-and-column%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0












    $begingroup$

    Note that if your grid is $6 times 10$, you only have $5 times 9$ gaps, so the resulting grid is $440 times 260$. Otherwise your work is fine. There is no magic in choosing the size of the square, the size of the gap, and the arrangement. If your grid is $w$ squares wide, $h$ squares high, squares have a side of $s$, and the gap is $g$, the grid will occupy $(ws+(w-1)g) times (hs+(h-1)g)$ pixels. Pick the constants so it looks good to you.






    share|cite|improve this answer









    $endgroup$


















      0












      $begingroup$

      Note that if your grid is $6 times 10$, you only have $5 times 9$ gaps, so the resulting grid is $440 times 260$. Otherwise your work is fine. There is no magic in choosing the size of the square, the size of the gap, and the arrangement. If your grid is $w$ squares wide, $h$ squares high, squares have a side of $s$, and the gap is $g$, the grid will occupy $(ws+(w-1)g) times (hs+(h-1)g)$ pixels. Pick the constants so it looks good to you.






      share|cite|improve this answer









      $endgroup$
















        0












        0








        0





        $begingroup$

        Note that if your grid is $6 times 10$, you only have $5 times 9$ gaps, so the resulting grid is $440 times 260$. Otherwise your work is fine. There is no magic in choosing the size of the square, the size of the gap, and the arrangement. If your grid is $w$ squares wide, $h$ squares high, squares have a side of $s$, and the gap is $g$, the grid will occupy $(ws+(w-1)g) times (hs+(h-1)g)$ pixels. Pick the constants so it looks good to you.






        share|cite|improve this answer









        $endgroup$



        Note that if your grid is $6 times 10$, you only have $5 times 9$ gaps, so the resulting grid is $440 times 260$. Otherwise your work is fine. There is no magic in choosing the size of the square, the size of the gap, and the arrangement. If your grid is $w$ squares wide, $h$ squares high, squares have a side of $s$, and the gap is $g$, the grid will occupy $(ws+(w-1)g) times (hs+(h-1)g)$ pixels. Pick the constants so it looks good to you.







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered Mar 18 '13 at 14:13









        Ross MillikanRoss Millikan

        299k24200374




        299k24200374






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Mathematics Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            Use MathJax to format equations. MathJax reference.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f332939%2fhow-can-i-calculate-the-size-of-a-square-block-and-the-number-of-rows-and-column%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Magento 2 - Add success message with knockout Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Success / Error message on ajax request$.widget is not a function when loading a homepage after add custom jQuery on custom themeHow can bind jQuery to current document in Magento 2 When template load by ajaxRedirect page using plugin in Magento 2Magento 2 - Update quantity and totals of cart page without page reload?Magento 2: Quote data not loaded on knockout checkoutMagento 2 : I need to change add to cart success message after adding product into cart through pluginMagento 2.2.5 How to add additional products to cart from new checkout step?Magento 2 Add error/success message with knockoutCan't validate Post Code on checkout page

            Fil:Tokke komm.svg

            Where did Arya get these scars? Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar Manara Favourite questions and answers from the 1st quarter of 2019Why did Arya refuse to end it?Has the pronunciation of Arya Stark's name changed?Has Arya forgiven people?Why did Arya Stark lose her vision?Why can Arya still use the faces?Has the Narrow Sea become narrower?Does Arya Stark know how to make poisons outside of the House of Black and White?Why did Nymeria leave Arya?Why did Arya not kill the Lannister soldiers she encountered in the Riverlands?What is the current canonical age of Sansa, Bran and Arya Stark?