3
$\begingroup$

I have the following data

DATA1={{1,-70.54,-70.54,-70.54,2875.63,203.21,40946.81,2298.26,0.19,0.0022,0.96,11.,88.29,2060.,-0.00404,-2050.,0.0103},{2,-75.16,-75.16,-75.16,2790.36,20.759,20685.47,468.783,0.16,0.022,0.98,79.,447.5,130.,-0.612,15.3,71.4},{3,-74.36,-74.36,-74.36,2995.82,206.31,66549.29,2880.45,0.21,0.0012,0.046,15.,77.35,24.5,-0.376,2.44,87.5},{4,-73.98,-73.98,-73.98,2957.59,204.08,43170.78,2829.02,0.23,0.0018,0.078,21.,77.36,43.3,-0.817,7.68,80.0},{5,-82.51,-82.51,-82.51,2963.79,538.94,50524.51,5376.89,0.25,0.00090,0.048,13.,45.47,6.89,1.,-1.21,9.65},{6,-83.78,-83.78,-83.78,2694.16,429.32,79162.48,4369.53,0.24,0.00065,0.030,15.,51.64,4.50*10^(6),-6.35*10^(-7),-4.50*10^(6),0.0000204},{7,-75.72,-75.72,-75.72,2949.44,213.08,77672.58,2071.73,0.23,0.0014,0.070,44.,107.8,5.05*10^(6),8.44*10^(-7),-5.05*10^(6),0.0000433}};
DATA2={{1,-74.01,-74.01,-74.01,2939.66,191.54,2169.407,2135.48,0.22,0.047,0.31,92.,101.9,-84.9,-4.7,80.9,-363.},{2,-75.19,-75.19,-75.19,792.686,0.69101,931.1111,83.5431,0.78,0.77,0.92,78.,713.4,32.4,-1.28,68.3,60.0},{3,-78.77,-78.77,-78.77,2832.86,281.89,66859.41,2414.00,0.24,0.0014,0.21,25.,92.41,39.4,-1.30,3.81,22.9},{4,-80.81,-80.81,-80.81,2913.93,234.38,37534.88,2223.32,0.23,0.0028,0.14,20.,105.9,46.9,-1.38,-0.510,73.1},{5,-76.29,-76.29,-76.29,2972.13,203.95,39781.13,1883.95,0.23,0.0030,0.094,21.,120.4,147.,-2.59,-1.97,107.},{6,-78.18,-78.18,-78.18,2992.97,213.32,38167.21,1777.47,0.25,0.0034,0.096,23.,131.7,93.7,-1.91,-2.94,49.9},{7,-75.59,-75.59,-75.59,2311.95,375.80,93875.21,3315.32,0.24,0.00056,0.018,6.3,52.69,183.,-0.0709,-169.,0.188},{8,-69.11,-69.11,-69.11,2980.73,598.49,72226.15,7143.61,0.24,0.00040,0.24,0.28,28.84,0.956,0.411,0.149,264.},{9,-68.97,-68.97,-68.97,2679.44,394.60,28449.60,7348.71,0.13,0.00088,0.037,14.,25.16,37.6,-0.890,-0.109,32.4},{10,-69.5,-69.5,-69.5,2871.99,415.67,15755.71,5069.04,0.24,0.0025,0.024,1.6,39.38,64.8,-3.33,-0.658,25.0}};

I construct the following grids

GRID1=Grid[Prepend[Prepend[DATA1,{Style["#",Bold],Style["Subscript[E, L]",Bold],Style["Subscript[V, th]",Bold],Style["Subscript[V, r]",Bold],Style["Cm",Bold],Style["Subscript[I, th]",Bold],Style["Subscript[\[Tau], m]",Bold],Style["K",Bold],Style["\[Beta]",Bold],Style["\[Delta]",Bold],Style["Subscript[I, dep]^start",Bold],Style["Subscript[I, dep0]",Bold],Style["\[Tau]",Bold],Style["a",Bold],Style["b",Bold],Style["c",Bold],Style["d",Bold]}],{Style["DATI 1",Bold],SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft}],Background->{None,{Lighter[Blue,.9],Lighter[Blue,.9],{White,Lighter[Gray,.8]}}},Dividers->{{Black,Darker[Gray,.6],{Lighter[Gray,.5]},Darker[Gray,.6]},{Black,Darker[Gray,.6],Darker[Gray,.6],{False},Darker[Gray,.6]}},Alignment->{{Center,Center,Center}},ItemSize->{All},Frame->Darker[Gray,.6],ItemStyle->14,Spacings->{1,1}];
GRID2=Grid[Prepend[Prepend[DATA2,{Style["#",Bold],Style["Subscript[E, L]",Bold],Style["Subscript[V, th]",Bold],Style["Subscript[V, r]",Bold],Style["Cm",Bold],Style["Subscript[I, th]",Bold],Style["Subscript[\[Tau], m]",Bold],Style["K",Bold],Style["\[Beta]",Bold],Style["\[Delta]",Bold],Style["Subscript[I, dep]^start",Bold],Style["Subscript[I, dep0]",Bold],Style["\[Tau]",Bold],Style["a",Bold],Style["b",Bold],Style["c",Bold],Style["d",Bold]}],{Style["DATI 2",Bold],SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft}],Background->{None,{Lighter[Blue,.9],Lighter[Blue,.9],{White,Lighter[Gray,.8]}}},Dividers->{{Black,Darker[Gray,.6],{Lighter[Gray,.5]},Darker[Gray,.6]},{Black,Darker[Gray,.6],Darker[Gray,.6],{False},Darker[Gray,.6]}},Alignment->{{Center,Center,Center}},ItemSize->{All},Frame->Darker[Gray,.6],ItemStyle->14,Spacings->{1,1}];

I would like to combine these two GRID together, namely one up and the other down in order to form one single table.

$\endgroup$
2
  • $\begingroup$ we should replace "Subscript[E, L]" by Subscript[E, L] etc. $\endgroup$
    – cvgmt
    Apr 9, 2022 at 23:06
  • $\begingroup$ Is this only for display purposes? For instance is Grid[{{GRID1}, {GRID2}}, Alignment -> {Left, Left}, Frame -> All] what you want? $\endgroup$
    – bmf
    Apr 9, 2022 at 23:23

1 Answer 1

0
$\begingroup$

I would like to obtain something like that

enter image description here

Of course I would like also that each column have also the same size. I would like to keep the blue background parts as they are in the above picture.

The solution I have found is to insert in GRID1 and GRID2 in ItemSize the same numbers, namely

GRID1=Grid[Prepend[Prepend[DATA1,{Style["#",Bold],Style["Subscript[E, L]",Bold],Style["Subscript[V, th]",Bold],Style["Subscript[V, r]",Bold],Style["Cm",Bold],Style["Subscript[I, th]",Bold],Style["Subscript[\[Tau], m]",Bold],Style["K",Bold],Style["\[Beta]",Bold],Style["\[Delta]",Bold],Style["Subscript[I, dep]^start",Bold],Style["Subscript[I, dep0]",Bold],Style["\[Tau]",Bold],Style["a",Bold],Style["b",Bold],Style["c",Bold],Style["d",Bold]}],{Style["DATI 1",Bold],SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft}],Background->{None,{Lighter[Blue,.9],Lighter[Blue,.9],{White,Lighter[Gray,.8]}}},Dividers->{{Black,Darker[Gray,.6],{Lighter[Gray,.5]},Darker[Gray,.6]},{Black,Darker[Gray,.6],Darker[Gray,.6],{False},Darker[Gray,.6]}},Alignment->{{Center,Center,Center}},ItemSize->{{2, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 7, 7}, 1},Frame->Darker[Gray,.6],ItemStyle->14,Spacings->{1,1}];
GRID2=Grid[Prepend[Prepend[DATA2,{Style["#",Bold],Style["Subscript[E, L]",Bold],Style["Subscript[V, th]",Bold],Style["Subscript[V, r]",Bold],Style["Cm",Bold],Style["Subscript[I, th]",Bold],Style["Subscript[\[Tau], m]",Bold],Style["K",Bold],Style["\[Beta]",Bold],Style["\[Delta]",Bold],Style["Subscript[I, dep]^start",Bold],Style["Subscript[I, dep0]",Bold],Style["\[Tau]",Bold],Style["a",Bold],Style["b",Bold],Style["c",Bold],Style["d",Bold]}],{Style["DATI 2",Bold],SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft,SpanFromLeft}],Background->{None,{Lighter[Blue,.9],Lighter[Blue,.9],{White,Lighter[Gray,.8]}}},Dividers->{{Black,Darker[Gray,.6],{Lighter[Gray,.5]},Darker[Gray,.6]},{Black,Darker[Gray,.6],Darker[Gray,.6],{False},Darker[Gray,.6]}},Alignment->{{Center,Center,Center}},ItemSize->{{2, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 7, 7}, 1},Frame->Darker[Gray,.6],ItemStyle->14,Spacings->{1,1}];

And after

Grid[{{GRID1},{GRID2}},Alignment->{Left,Left}]
$\endgroup$
2
  • $\begingroup$ Isn't this what @bmf proposed earlier? $\endgroup$
    – bbgodfrey
    Apr 10, 2022 at 4:36
  • $\begingroup$ Yes almost, I changed in GRID1 and GRID2 the ItemSize, as you can see comparing my last version (ItemSize->{{2, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 7, 7}, 1}) with that posted initially (ItemSize->{All}). $\endgroup$
    – VDF
    Apr 10, 2022 at 8:15

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.