-2

There are N equally sized elements that need to be displayed/fit in a 2D matrix(table).
Which size is the best when the number of elements is not a perfect square?

Is it better to choose the matrix that looks closest to a square (rectangle with smallest perimeter)?
Is it better to choose the matrix which has the least number of empty cells left?
Is it better to choose 'vertical' or 'horizontal' looking matrix when the height and length are different?

Example 1: Which representation is best for 7 elements?
X X X
X X X
X
or
X X X X
X X X
or
X X
X X
X X
X
Example 2: Which representation is best for 17 elements?
X X X X
X X X X
X X X X
X X X X
X
or
X X X X X
X X X X X
X X X X X
X X
or
X X X
X X X
X X X
X X X
X X X
X X
or
X X X X X X
X X X X X X
X X X X X

What is the best way to display the elements in the general case when N varies?

4
  • Hi. Welcome to GDSE. It would depend on how much space is available on a page or screen, what orientation it happens to be, whether there are other elements on the page/screen, etc. I don't think it's possible to answer this question without more information. Also "best" is a highly subjective term. What is best for someone might not be best for someone else. Can you please edit your question and provide more information, including what you actually need this for. What actual layout problems are you trying to solve here?
    – Billy Kerr
    Commented Nov 13 at 11:39
  • @BillyKerr by 'best' I meant aesthetically pleasing. for me, in the 17 elements case, 4r x 4c + 1 looks 'uglier' than 2r x 6c + 5. I was wondering if there are any conventions on this type of problem. But as you mentioned, it might depend on the context the 'best' way to choose the size of the container(matrix/table).
    – aku jack
    Commented Nov 13 at 12:01
  • There's too many factors for this to be very answerable: what limitations are there? What subject matter? What context? etc. Commented Nov 13 at 16:09
  • "aesthetically pleasing" is also too subjective a term. What if you are viewing it on a narrow phone screen for example? What if there is a massive block of text on the screen too, and you only have a narrow vertical band for a table. Do you see the issue here? It depends on what you want or need.
    – Billy Kerr
    Commented Nov 13 at 16:26

1 Answer 1

-1

Apart from the subjective sense of what shape is more aesthetic, you can choose a size depending on how you'd like to guide the reader's eyes.

  • If there are many elements, do not expect the reader to look carefully at each cell. In this case, I would advise you to choose a compact size (few blank cells). This presentation makes the table compact and does not incite the reader to go through it. The main message remains that the table is here if needed.
  • On contrary, if you want the reader to read the table, choose a graphic style that facilitates this task. Center the text in each cell, and add space around, so that the text feels light and easier to read. Choose the numbers of rows and columns to decrease the aspect ratio (width:height). A lower aspect ratio gives the reader the impression of missing a longer portion of the main text.

Other suggestions apply if you want to highlight some specific elements of the table, or on the contrary hide them, or even show similarities between some cells. The main takeaway remains the same: you can guide the public through the reading process, and your way to do this defines how you format your data!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.