Message Boards Message Boards

0
|
3710 Views
|
7 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Wrap the columns of Grid or TableForm to the right?

Posted 2 years ago

TableFrom -- readable but waste of space and loss of comprehension

enter image description here

Row -- good use of space but unreadable and loss of comprehension

enter image description here

Is there a way to wrap the Grid / TableForm to make better use of white space??

POSTED BY: Raymond Low
7 Replies
Posted 2 years ago

Take the first 6 rows of the "multi-column":

list = Table[{i, RandomInteger[{10, 150}], 
   RandomInteger[{0, 50}]}, {i, 178}]; data = 
 Partition[list, UpTo[30]];
Grid[{Map[Grid, Map[Take[#, {1, 6}] &, data]]}, Frame -> All, 
 Alignment -> Top]

enter image description here

Take the rest of the "multi-column":

Grid[{Map[Grid, Map[Take[#, {7, -1}] &, data]]}, Frame -> All, 
 Alignment -> Top]

enter image description here

POSTED BY: Oliver Seipel
Posted 2 years ago

Maybe the inbuilt function Multicolumn could be of use?

table = Table[{i, i^2, i^3}, {i, 30}]

enter image description here

POSTED BY: Hans Milton
Posted 2 years ago

Very good, Thank you Oliver, that worked. I can see all the data in one screen versus scrolling through four to six screens, but does not display in "Code Sample" so displayed as a picture So how the code works is that you are breaking up a list of178 elements of 3 elements each, to a list of 6 elements of 30 elements of 3 elements each and the first Grid is making a Table of the first 6 elements?

enter image description here

POSTED BY: Raymond Low
Posted 2 years ago

This is like a multi-column:

list = Table[{i, RandomInteger[{10, 150}], 
    RandomInteger[{0, 50}]}, {i, 20}];
Grid[{Map[Grid, Partition[list, UpTo[7]]]}, Frame -> All, 
 Alignment -> Top]

enter image description here

POSTED BY: Oliver Seipel

Welcome to Wolfram Community! Please make sure you know the rules: https://wolfr.am/READ-1ST

The rules explain how to format your code properly. Posting code Images doesn't help other members to copy your code. Please EDIT your post and make sure code blocks start on a new paragraph and look framed and colored like this.

int = Integrate[1/(x^3 - 1), x];
Map[Framed, int, Infinity]

You can also embed notebook or attach notebook.

enter image description here

POSTED BY: Moderation Team
Posted 2 years ago

Thanks for the reply, but I am not worried about the white space between columns. What I would like is another three columns (Table) wrapped next to the existing Table from the screen below so the space to the right of the Table is filled up -- That way I can see more data without having to scroll down.

POSTED BY: Raymond Low

TableSpacing option looks useful in your case:

TableForm[
   Table[{i,RandomInteger[{10,150}],RandomInteger[{0,50}]},{i,7}],
TableSpacing->{1, 1.2}]

enter image description here

POSTED BY: Shenghui Yang
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract