4
$\begingroup$

I have a long table that I want to include on a PowerPoint page. I intend to truncate some data in the middle to ensure it fits on one page. How can I achieve this while indicating that the table continues in the middle? It would be ideal if it could be implemented with a torn edge paper effect in the middle.

enter image description here

data = Table[{i, i^2, i^3}, {i, 1, 30}];
Grid[Join[{{"x", "x^2", "x^3"}}, data], Frame -> All, 
 Alignment -> Center]
$\endgroup$

5 Answers 5

6
$\begingroup$

It is not ultra-realistic but ...

Clear["Global`*"];
data = Table[{i, i^2, i^3}, {i, 1, 30}];
bpbottom = Import["https://i.stack.imgur.com/8EDki.png"];
bptop = Import["https://i.stack.imgur.com/3WwQd.jpg"];
divstop = Flatten[#, 1] &@Table[{i, j} -> True, {i, 1, 7}, {j, 1, 3}];
g1 = Grid[
   Join[{{"x", "x^2", "x^3"}}, 
    data[[1 ;; 6]], {{bpbottom, SpanFromLeft}}]
   , Dividers -> {}
   , Frame -> {None, None, divstop}
   , Alignment -> {Center, Center}
   , ItemSize -> {{2, 5, 5}, {{1.4}, 1}}
   , Background -> {None, {{None}, GrayLevel[0.6], 
      Blend[{White, Black, Brown}], None}}
   ];

divsdn = Flatten[#, 1] &@Table[{i, j} -> True, {i, 2, 7}, {j, 1, 3}];
g2 = Grid[{{bptop, SpanFromLeft}}~Join~data[[-6 ;;]]
   , Dividers -> {}
   , Frame -> {None, None, divsdn
     }
   , Alignment -> {Center, Center}
   , ItemSize -> {{2, 5, 5}, 1.4}
   , Background -> {None, {None, Blend[{White, Black, Brown}], 
      GrayLevel[0.6]}, {None}}
   ];

Grid[List /@ {Rotate[g1, 1 Degree], Rotate[g2, -2 Degree]}, 
 Spacings -> {0, -1}]

enter image description here

$\endgroup$
1
  • 2
    $\begingroup$ ...but I like it $\endgroup$
    – eldo
    Feb 7 at 14:06
6
$\begingroup$
tearGrid[rows_, side_] := Fold[
    ImageEffect, 
    Rasterize @ MapAt[Take[#, rows] &, {1}]@#, 
    {{"TornFrame", Scaled[1/10], side}, 
     {"FadedFrame", Scaled[1/2], side}}] &;

Examples:

data = Table[{i, i^2, i^3}, {i, 1, 30}];

grid = Grid[Join[{{"x", "x^2", "x^3"}}, data], 
  Frame -> All, Alignment -> Center];

Take first 10 rows and blur at the bottom:

tearGrid[10, Bottom] @ grid 

enter image description here

Take last 10 rows and blur at the top:

tearGrid[-10, Top] @ grid 

enter image description here

Take rows 7 to 15 and blur at top and bottom:

tearGrid[{7, 15}, {Top, Bottom}] @ grid 

enter image description here

Take the first and last 10 rows and blur in the middle:

grid2 = Append[{ItemSize -> {3, 1}, Background -> LightGreen}] @ grid;

Column[{tearGrid[10, Bottom] @ grid2, tearGrid[-10, Top] @ grid2}, 
 Spacings -> 1 ]

enter image description here

$\endgroup$
3
$\begingroup$

One possibility

Mathematica graphics

code

data = Table[{i, i^2, i^3}, {i, 1, 30}];
data1 = Join[{{"x", "x^2", "x^3"}}, data[[1 ;; 6]]];
ve = {⋮, ⋮, ⋮};
data1 = Join[data1, {ve}];
frameIt = Item[#, Frame -> {False, True, True, True}] & /@ # &;
g1 = Grid[MapAt[frameIt, data1, Table[{i}, {i, 1, Length@data1}]]];
data2 = Join[{ve}, data[[20 ;; Length@data]]];
frameIt = Item[#, Frame -> {True, True, False, True}] & /@ # &;
g2 = Grid[MapAt[frameIt, data2, Table[{i}, {i, 1, Length@data2}]]];

You can paste each g in different power point page. Adjust sizes as needed.

Reference

In Grid and using Frame, how can I only frame the header cells?

$\endgroup$
3
$\begingroup$
blurSides = Fold[ImageEffect, #, 
  {{"TornFrame", Scaled[1/10], #2}, {"FadedFrame", Scaled[1/2], #2}}] &;

blurMiddle[n_ : 1/3] := Style[#, Magnification -> .25] & @
   ImageAssemble @ Map[List] @ MapThread[blurSides] @ 
   {Flatten @ ImagePartition[#, ImageDimensions[#]{1, n}][[{1, -1}]] & @
   Rasterize[#, "Image", ImageResolution -> 400], {Bottom, Top}} &

Examples:

data = Table[{i, i^2, i^3}, {i, 1, 30}];

grid = Grid[Join[{{"x", "x^2", "x^3"}}, data],
  Frame -> All, Alignment -> Center];

blurMiddle[] @ grid

enter image description here

Take top and bottom 1/4 of the rasterized grid:

blurMiddle[1/4] @ grid

enter image description here

$\endgroup$
3
$\begingroup$
ClearAll[breakRow, rippedGrid]

breakRow[freq_ : 4, gap_ : 1, aspectratio_ : 1/8, fillingstyle_ : White] := 
 Plot[{TriangleWave[ x  freq], TriangleWave[x  freq] - gap}, 
   {x, 0, 1},
   Filling -> {1 -> {2}},
   FillingStyle -> Opacity[1, fillingstyle],
   AspectRatio -> aspectratio, 
   ImageSize -> {Scaled[1.1], All},
   PlotHighlighting -> None, 
   PlotStyle -> Directive[Thin, Opacity[1], Black], 
   ImagePadding -> 0, ImageMargins -> 0, Axes -> False,
   PlotRangePadding -> 0]

rippedGrid[{fromrow_, torow_}, freq_ : 4, gap_ : 1, 
   aspectratio_ : 1/8, fillingstyle_ : White] := 
  Module[{g = Delete[#, Thread[{1, Range[fromrow, torow]}]]}, 
    ReplacePart[g, 
      {{1, fromrow - 1} ->
        {Item[breakRow[freq, gap, aspectratio, fillingstyle], 
          Frame -> {{True, True}, {False, False}}], SpanFromLeft},
      {1, fromrow} -> 
        (Item[#, Frame -> {{True, True}, {True, False}}] & /@ 
          g[[1, fromrow]])}]] &;

Examples:

data = Table[{i, i^2, i^3}, {i, 1, 30}];

grid = Grid[Join[{{"x", "x^2", "x^3"}}, data], 
   Frame -> All, Alignment -> Center];


grid2 = Append[{ItemSize -> {3, 1}, 
     Background -> {LightBlue, {1 -> LightGray}}}] @ grid;

grid3 = Append[{ItemSize -> {10, 1}, 
     Background -> {LightBlue, Prepend[1 -> LightGray] @
        Thread[{10, 11, 12} -> Lighter@LightBlue]}}] @ grid;

Row[{rippedGrid[{9, 25}] @ grid2,
     rippedGrid[{12, 23}, 16, 1, 1/30] @ grid3}, 
    Spacer[10]]

enter image description here

$\endgroup$
1
  • $\begingroup$ I prefer this much more. $\endgroup$
    – internet
    Feb 8 at 7:37

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.