Tag Info

New answers tagged

3

Update 2: Rather than processing the table m to add headers, we can define a function modifyF that modifies f to return first and/or second argument passed to f for specific argument patterns; and, then use modifyF[f] to construct the table. One way, out of many ways, to do that is: ClearAll[modifyF]; modifyF[f_] := {##} /. {{_String, a_} :> a, {b_, ...


1

Is it possible to change structure and use a Grid instead? For example, the below gives you what you want (and it continues to make use of spaces for indentation, which you did in your example attempt). Grid[ { { "Level1a", "Level1b" }, { " Level2a", " Level2c" }, { Column[{" Level3a"," Level3b"}], ...


2

This is a canonical way of getting what you want: data = Table[i[j], {i, {f, g}}, {j, 1, 5}]; TraditionalForm@TableForm[ data, TableHeadings -> {{f, g}, Range[5]}] \begin{array}{c|ccccc} \text{} & 1 & 2 & 3 & 4 & 5 \\ \hline f & f(1) & f(2) & f(3) & f(4) & f(5) \\ g & g(1) & g(2) & g(3) & ...


0

Although there are probably slightly more elegant answers, the following works: gridDraw[N_] := Module[{aRange = Range[N], bRange = Range[N], cRange}, PrependTo[bRange, ""]; Grid[{bRange, Flatten[{f, f /@ aRange}], Flatten[{g, g /@ aRange}]}, Frame -> All]] By just calling: gridDraw[5] You get exactly the same as above (apart from the square ...


3

(*auxiliary functions*) wrap = Function[item, Pane[item, {90, 90/GoldenRatio}, FrameMargins -> 0, ImageMargins -> 0, Alignment -> Center] , Listable]; grid = Grid[#, Spacings -> {0, 0}, Alignment -> {Left, Center}] &; (*I don't know what you are doing so I'm making up data:*) data ...



Top 50 recent answers are included