Arrange and display parts of grids in Mathematica

To quickly find the location of my data, I show a table with the names of the variables, as well as information about each of them.

Since I have many columns (variable), I copy and paste them into the cell to have them all on 1 screen.

I would like to encode this, so that I would introduce several ranges of lines that need to be extracted and displayed efficiently, like on a grid that will fit the area of ​​the screen? I have not yet managed to display 2 grids together.

If I mis-formulated my problem above, here is a simple example:

How to transfer the blue part to the pink, if the conclusion laListis what we have to deal with?

co1    = Range[6];
co2    = Range[11, 16];
co3    = {"A", "B", "C", "D", "E", "F"};

laList = Join[{co1}, {co2}, {co3}] // Transpose;

laListGraph = Grid[laList,
Dividers -> All,
Alignment -> {Left, Center},
ItemSize -> Automatic,
ItemStyle -> Directive[FontSize -> 14, Black, Italic, Bold],
Spacings -> {2, 1},
 Background -> {None, None, {
     {{1, 3}, {1, 3}} -> LightRed,
     {{4, 6}, {1, 3}} -> LightBlue
   } } ]
+3
source share
3 answers

. laList, :

laList2 = ArrayFlatten @ {Partition[laList, 3]};

Grid[laList2,
Dividers -> All,
Alignment -> {Left, Center},
ItemSize -> Automatic,
ItemStyle -> Directive[FontSize -> 14, Black, Italic, Bold],
Spacings -> {2, 1},
 Background -> {None, None, {
     {{1, 3}, {1, 3}} -> LightRed,
     {{1, 3}, {4, 6}} -> LightBlue
   } }
]

enter image description here

:

  • 3 Partition .

  • LightBlue .


yoda, :

subgrid= Grid[#1,
         Dividers  -> All,
         Alignment -> {Left, Center}, 
         ItemSize  -> Automatic, 
         ItemStyle -> Directive[FontSize -> 14, Black, Italic, Bold], 
         Spacings  -> {2, 1}, 
         Background-> #2] &;

MapThread[subgrid, {Partition[laList, 3], {LightRed, LightBlue}}] //Row

, , :

MapThread[subgrid, {
  Partition[laList, 4, 4, 1, {}],
  {LightRed, LightBlue}
}] //Row

enter image description here

+1

EDIT:

-, , , , ... , , . . , , ...

(Grid[#1, Dividers -> All, Alignment -> {Left, Center}, 
     ItemSize -> Automatic, 
     ItemStyle -> Directive[FontSize -> 14, Black, Italic, Bold], 
     Spacings -> {2, 1}, 
     Background -> {None, 
       None, {{1, 3}, {1, 3}} -> #2}] &) @@@ {{laList[[;; 3, All]], 
    LightRed}, {laList[[4 ;;, All]], LightBlue}} // Row

enter image description here

+4

, , , "". :

showG[l_List] :=
  Grid[Join[
    l[[ ;; IntegerPart[Length@l/2]]],
    l[[IntegerPart[Length@l/2] + 1 ;;]]
    , 2], Frame -> All];

showG[laList]

enter image description here

@Mr. :

showG[l_List] :=
  Grid[Join[l[[ ;; #]], l[[# + 1 ;;]], 2], Frame -> All] &@ Floor[Length@l/2];
+4

All Articles