# Adding columns to an existing table [duplicate]

I have two tables that look something like-

39.3278 2990.3 4503.98 0 -1859.37
35.7833 3014.8 1281.98 0 -3497.95


and

0.0255 28.6 -9.954 -2.612
0.0724 28.7 -1.031 -1.435


I am trying to generate a grand table by joining these two tables that should look something like this-

39.3278 2990.3 4503.98 0 -1859.37 0.0255 28.6 -9.954 -2.612
35.7833 3014.8 1281.98 0 -3497.95 0.0724 28.7 -1.031 -1.435


The code that I am using is-

data1 = {{39.3278, 2990.3, 4503.98, 0, -1859.37}, {35.7833, 3014.8,
1281.98, 0, -3497.95}};
data2 = {{0.0255, 28.6, -9.954, -2.612}, {0.0724,
28.7, -1.031, -1.435}};
data = Transpose@Join[Transpose@data1, data2];
TableForm[data]


But above code is showing the error that levels can not be transposed. What is the possible solution to this problem?

• At least closely related: 103834, 67423
– Kuba
May 21, 2017 at 19:44

d1 = {{39.3278, 2990.3, 4503.98, 0, -1859.37}, {35.7833, 3014.8, 1281.98,
0, -3497.95}};
d2 = {{0.0255, 28.6, -9.954, -2.612}, {0.0724, 28.7, -1.031, -1.435}};

Join[d1, d2, 2]

{{39.3278, 2990.3, 4503.98, 0, -1859.37, 0.0255, 28.6, -9.954, -2.612},
{35.7833, 3014.8, 1281.98, 0, -3497.95, 0.0724, 28.7, -1.031, -1.435}}

• mathematica.stackexchange.com/q/121522/5478
– Kuba
May 21, 2017 at 20:08
• @Kuba Hm... I did not mean to be capricious. I did not remember that instance. Recommended action? May 21, 2017 at 20:12
• I know, happens to me too. Don't know yet, this surely has be asked many times and will be, maybe we should think about some cleaning in list-manipulation faqs. Since "elegant operations" is already a multiquestion guideline maybe it would not harm to add some more common activities.
– Kuba
May 21, 2017 at 21:19
• Duplicate from early 2012: mathematica.stackexchange.com/questions/189/… May 21, 2017 at 22:51
• @Mike That is not a simple duplicate however, unfortunately. Yes, an answer exists within but not one that is likely to be noticed and understood by a beginner as it is complicated by the need to convert rows to columns. It is the first Q&A I linked from (121522) but there too I did not think it an ideal duplicate as I did not mark that one as such. May 22, 2017 at 6:34