Tabular align on equals sign [duplicate]












1
















This question already has an answer here:




  • Align Equations Over Multiple Tabular Rows

    2 answers




I'm pretty new to LaTeX, so sorry for the beginner question. I'm trying to align on equals signs within tabular, however a few rows are blank and don't have equals signs. How can I do this? Thanks!



documentclass{article}
usepackage[utf8]{inputenc}
usepackage{multirow, adjustbox, mathtools}
begin{document}

begin{table}[htbp]
begin{adjustbox}{width=columnwidth,center}
begin{tabular}{|c|c|c|c|c|}
hline
Force Field & Calculated Energy & Calculated Difference & Experimental Difference & Error \
hline

multirow{4}{*}{OPLS-AA}
& tt = 2.55447 & && \ cline{2-5}
& $text{g}^+text{g}^+$ = 4.19785 & $text{g}^+text{g}^+$-tt = 1.64338 & $text{g}^+text{g}^+$-tt = 1.62 & 0.02338 \ cline{2-5}
& $text{g}^+text{g}^-$ = 5.56306 & $text{g}^+text{g}^-$-tt = 3.00859 & $text{g}^+text{g}^-$-tt = 3.51 & -0.50141 \ cline{2-5}
& tg = 3.36156 & tg-tt = 0.80709 & tg-tt = 0.86 & -0.05291 \ cline{2-5}
hline

multirow{4}{*}{AM1}
& tt = -37.97281 & && \ cline{2-5}
& $text{g}^+text{g}^+$ = -36.52659 & $text{g}^+text{g}^+$-tt = 1.44622 & $text{g}^+text{g}^+$-tt = 1.62 & -0.17378 \ cline{2-5}
& $text{g}^+text{g}^-$ = -35.85939 & $text{g}^+text{g}^-$-tt = 2.11342 & $text{g}^+text{g}^-$-tt = 3.51 & -1.39658 \ cline{2-5}
& tg = -37.25846 & tg-tt = 0.71435 & tg-tt = 0.86 & -0.14565 \ cline{2-5}
hline

multirow{4}{*}{PDDG/PM3}
& tt = -34.61227 & && \ cline{2-5}
& $text{g}^+text{g}^+$ = -33.94462 & $text{g}^+text{g}^+$-tt = 0.66765 & $text{g}^+text{g}^+$-tt = 1.62 & -0.95235 \ cline{2-5}
& $text{g}^+text{g}^-$ = -33.29225 & $text{g}^+text{g}^-$-tt = 1.32002 & $text{g}^+text{g}^-$-tt = 3.51 & -2.18998 \ cline{2-5}
& tg = -34.38819 & tg-tt = 0.22408 & tg-tt = 0.86 & -0.63592 \ cline{2-5}
hline
end{tabular}
end{adjustbox}
end{table}

end{document}


Table Output










share|improve this question















marked as duplicate by subham soni, Raaja, marmot, JouleV, Andrew Swann Mar 22 at 7:03


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.



















  • Welcome to TeX.SE!

    – Kurt
    Mar 22 at 2:20
















1
















This question already has an answer here:




  • Align Equations Over Multiple Tabular Rows

    2 answers




I'm pretty new to LaTeX, so sorry for the beginner question. I'm trying to align on equals signs within tabular, however a few rows are blank and don't have equals signs. How can I do this? Thanks!



documentclass{article}
usepackage[utf8]{inputenc}
usepackage{multirow, adjustbox, mathtools}
begin{document}

begin{table}[htbp]
begin{adjustbox}{width=columnwidth,center}
begin{tabular}{|c|c|c|c|c|}
hline
Force Field & Calculated Energy & Calculated Difference & Experimental Difference & Error \
hline

multirow{4}{*}{OPLS-AA}
& tt = 2.55447 & && \ cline{2-5}
& $text{g}^+text{g}^+$ = 4.19785 & $text{g}^+text{g}^+$-tt = 1.64338 & $text{g}^+text{g}^+$-tt = 1.62 & 0.02338 \ cline{2-5}
& $text{g}^+text{g}^-$ = 5.56306 & $text{g}^+text{g}^-$-tt = 3.00859 & $text{g}^+text{g}^-$-tt = 3.51 & -0.50141 \ cline{2-5}
& tg = 3.36156 & tg-tt = 0.80709 & tg-tt = 0.86 & -0.05291 \ cline{2-5}
hline

multirow{4}{*}{AM1}
& tt = -37.97281 & && \ cline{2-5}
& $text{g}^+text{g}^+$ = -36.52659 & $text{g}^+text{g}^+$-tt = 1.44622 & $text{g}^+text{g}^+$-tt = 1.62 & -0.17378 \ cline{2-5}
& $text{g}^+text{g}^-$ = -35.85939 & $text{g}^+text{g}^-$-tt = 2.11342 & $text{g}^+text{g}^-$-tt = 3.51 & -1.39658 \ cline{2-5}
& tg = -37.25846 & tg-tt = 0.71435 & tg-tt = 0.86 & -0.14565 \ cline{2-5}
hline

multirow{4}{*}{PDDG/PM3}
& tt = -34.61227 & && \ cline{2-5}
& $text{g}^+text{g}^+$ = -33.94462 & $text{g}^+text{g}^+$-tt = 0.66765 & $text{g}^+text{g}^+$-tt = 1.62 & -0.95235 \ cline{2-5}
& $text{g}^+text{g}^-$ = -33.29225 & $text{g}^+text{g}^-$-tt = 1.32002 & $text{g}^+text{g}^-$-tt = 3.51 & -2.18998 \ cline{2-5}
& tg = -34.38819 & tg-tt = 0.22408 & tg-tt = 0.86 & -0.63592 \ cline{2-5}
hline
end{tabular}
end{adjustbox}
end{table}

end{document}


Table Output










share|improve this question















marked as duplicate by subham soni, Raaja, marmot, JouleV, Andrew Swann Mar 22 at 7:03


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.



















  • Welcome to TeX.SE!

    – Kurt
    Mar 22 at 2:20














1












1








1


1







This question already has an answer here:




  • Align Equations Over Multiple Tabular Rows

    2 answers




I'm pretty new to LaTeX, so sorry for the beginner question. I'm trying to align on equals signs within tabular, however a few rows are blank and don't have equals signs. How can I do this? Thanks!



documentclass{article}
usepackage[utf8]{inputenc}
usepackage{multirow, adjustbox, mathtools}
begin{document}

begin{table}[htbp]
begin{adjustbox}{width=columnwidth,center}
begin{tabular}{|c|c|c|c|c|}
hline
Force Field & Calculated Energy & Calculated Difference & Experimental Difference & Error \
hline

multirow{4}{*}{OPLS-AA}
& tt = 2.55447 & && \ cline{2-5}
& $text{g}^+text{g}^+$ = 4.19785 & $text{g}^+text{g}^+$-tt = 1.64338 & $text{g}^+text{g}^+$-tt = 1.62 & 0.02338 \ cline{2-5}
& $text{g}^+text{g}^-$ = 5.56306 & $text{g}^+text{g}^-$-tt = 3.00859 & $text{g}^+text{g}^-$-tt = 3.51 & -0.50141 \ cline{2-5}
& tg = 3.36156 & tg-tt = 0.80709 & tg-tt = 0.86 & -0.05291 \ cline{2-5}
hline

multirow{4}{*}{AM1}
& tt = -37.97281 & && \ cline{2-5}
& $text{g}^+text{g}^+$ = -36.52659 & $text{g}^+text{g}^+$-tt = 1.44622 & $text{g}^+text{g}^+$-tt = 1.62 & -0.17378 \ cline{2-5}
& $text{g}^+text{g}^-$ = -35.85939 & $text{g}^+text{g}^-$-tt = 2.11342 & $text{g}^+text{g}^-$-tt = 3.51 & -1.39658 \ cline{2-5}
& tg = -37.25846 & tg-tt = 0.71435 & tg-tt = 0.86 & -0.14565 \ cline{2-5}
hline

multirow{4}{*}{PDDG/PM3}
& tt = -34.61227 & && \ cline{2-5}
& $text{g}^+text{g}^+$ = -33.94462 & $text{g}^+text{g}^+$-tt = 0.66765 & $text{g}^+text{g}^+$-tt = 1.62 & -0.95235 \ cline{2-5}
& $text{g}^+text{g}^-$ = -33.29225 & $text{g}^+text{g}^-$-tt = 1.32002 & $text{g}^+text{g}^-$-tt = 3.51 & -2.18998 \ cline{2-5}
& tg = -34.38819 & tg-tt = 0.22408 & tg-tt = 0.86 & -0.63592 \ cline{2-5}
hline
end{tabular}
end{adjustbox}
end{table}

end{document}


Table Output










share|improve this question

















This question already has an answer here:




  • Align Equations Over Multiple Tabular Rows

    2 answers




I'm pretty new to LaTeX, so sorry for the beginner question. I'm trying to align on equals signs within tabular, however a few rows are blank and don't have equals signs. How can I do this? Thanks!



documentclass{article}
usepackage[utf8]{inputenc}
usepackage{multirow, adjustbox, mathtools}
begin{document}

begin{table}[htbp]
begin{adjustbox}{width=columnwidth,center}
begin{tabular}{|c|c|c|c|c|}
hline
Force Field & Calculated Energy & Calculated Difference & Experimental Difference & Error \
hline

multirow{4}{*}{OPLS-AA}
& tt = 2.55447 & && \ cline{2-5}
& $text{g}^+text{g}^+$ = 4.19785 & $text{g}^+text{g}^+$-tt = 1.64338 & $text{g}^+text{g}^+$-tt = 1.62 & 0.02338 \ cline{2-5}
& $text{g}^+text{g}^-$ = 5.56306 & $text{g}^+text{g}^-$-tt = 3.00859 & $text{g}^+text{g}^-$-tt = 3.51 & -0.50141 \ cline{2-5}
& tg = 3.36156 & tg-tt = 0.80709 & tg-tt = 0.86 & -0.05291 \ cline{2-5}
hline

multirow{4}{*}{AM1}
& tt = -37.97281 & && \ cline{2-5}
& $text{g}^+text{g}^+$ = -36.52659 & $text{g}^+text{g}^+$-tt = 1.44622 & $text{g}^+text{g}^+$-tt = 1.62 & -0.17378 \ cline{2-5}
& $text{g}^+text{g}^-$ = -35.85939 & $text{g}^+text{g}^-$-tt = 2.11342 & $text{g}^+text{g}^-$-tt = 3.51 & -1.39658 \ cline{2-5}
& tg = -37.25846 & tg-tt = 0.71435 & tg-tt = 0.86 & -0.14565 \ cline{2-5}
hline

multirow{4}{*}{PDDG/PM3}
& tt = -34.61227 & && \ cline{2-5}
& $text{g}^+text{g}^+$ = -33.94462 & $text{g}^+text{g}^+$-tt = 0.66765 & $text{g}^+text{g}^+$-tt = 1.62 & -0.95235 \ cline{2-5}
& $text{g}^+text{g}^-$ = -33.29225 & $text{g}^+text{g}^-$-tt = 1.32002 & $text{g}^+text{g}^-$-tt = 3.51 & -2.18998 \ cline{2-5}
& tg = -34.38819 & tg-tt = 0.22408 & tg-tt = 0.86 & -0.63592 \ cline{2-5}
hline
end{tabular}
end{adjustbox}
end{table}

end{document}


Table Output





This question already has an answer here:




  • Align Equations Over Multiple Tabular Rows

    2 answers








tables math-mode align multicolumn






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 22 at 7:33







David

















asked Mar 22 at 2:02









DavidDavid

83




83




marked as duplicate by subham soni, Raaja, marmot, JouleV, Andrew Swann Mar 22 at 7:03


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









marked as duplicate by subham soni, Raaja, marmot, JouleV, Andrew Swann Mar 22 at 7:03


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.















  • Welcome to TeX.SE!

    – Kurt
    Mar 22 at 2:20



















  • Welcome to TeX.SE!

    – Kurt
    Mar 22 at 2:20

















Welcome to TeX.SE!

– Kurt
Mar 22 at 2:20





Welcome to TeX.SE!

– Kurt
Mar 22 at 2:20










1 Answer
1






active

oldest

votes


















1














Here is one approach. I split the columns using = into two columns. To get the spacing right (and save typing) I used @{$null=null$} between the columns. Unfortunately, this meant having to use multicolumn every time I didn't want a = to appear.



The only remaining problem was that when the label is too large, the extra space is added to the right half. To fix that, I calculated the difference and added extra space to the left half using makebox. Now the equal signs are centered.



documentclass{article}
usepackage[utf8]{inputenc}
usepackage{multirow, adjustbox, mathtools}
begin{document}

begin{table}[htbp]
begin{adjustbox}{width=columnwidth,center}
sbox0{Calculated Difference}%
sbox1{Experimental Difference}%
sbox2{$null=null$}%
dimen0=dimexpr wd0 - wd2relax
dimen1=dimexpr wd1 - wd2relax
begin{tabular}{|c|r@{$null=null$}l|r@{$null=null$}l|r@{$null=null$}l|c|}
hline
Force Field & multicolumn{2}{c|}{Calculated Energy} & multicolumn{2}{c|}{Calculated Difference} & multicolumn{2}{c|}{Experimental Difference} & Error \
hline
multirow{4}{*}{OPLS-AA}
& tt & 2.55447 & multicolumn{2}{c|}{} & multicolumn{2}{c|}{} & \ cline{2-8}
& $text{g}^+text{g}^+$ & 4.19785 & makebox[0.5dimen0][r]{$text{g}^+text{g}^+$-tt} & 1.64338
& makebox[0.5dimen1][r]{$text{g}^+text{g}^+$-tt} & 1.62 & 0.02338 \ cline{2-8}% note makebox
& $text{g}^+text{g}^-$ & 5.56306 & $text{g}^+text{g}^-$-tt & 3.00859 & $text{g}^+text{g}^-$-tt & 3.51 & -0.50141 \ cline{2-8}
& tg & 3.36156 & tg-tt & 0.80709 & tg-tt & 0.86 & -0.05291 \ cline{2-8}
hline

multirow{4}{*}{AM1}
& tt & -37.97281 & multicolumn{2}{c|}{} & multicolumn{2}{c|}{} & \ cline{2-8}
& $text{g}^+text{g}^+$ & -36.52659 & $text{g}^+text{g}^+$-tt & 1.44622 & $text{g}^+text{g}^+$-tt & 1.62 & -0.17378 \ cline{2-8}
& $text{g}^+text{g}^-$ & -35.85939 & $text{g}^+text{g}^-$-tt & 2.11342 & $text{g}^+text{g}^-$-tt & 3.51 & -1.39658 \ cline{2-8}
& tg & -37.25846 & tg-tt & 0.71435 & tg-tt & 0.86 & -0.14565 \ cline{2-8}
hline
multirow{4}{*}{PDDG/PM3}
& tt & -34.61227 & multicolumn{2}{c|}{} & multicolumn{2}{c|}{} & \ cline{2-8}
& $text{g}^+text{g}^+$ & -33.94462 & $text{g}^+text{g}^+$-tt & 0.66765 & $text{g}^+text{g}^+$-tt & 1.62 & -0.95235 \ cline{2-8}
& $text{g}^+text{g}^-$ & -33.29225 & $text{g}^+text{g}^-$-tt & 1.32002 & $text{g}^+text{g}^-$-tt & 3.51 & -2.18998 \ cline{2-8}
& tg & -34.38819 & tg-tt & 0.22408 & tg-tt & 0.86 & -0.63592 \ cline{2-8}
hline
end{tabular}
end{adjustbox}
end{table}

end{document}


demo





If you really want to center the fields...



Note: I used a tabular in sbox3 mostly to show what you have to do it you are not sure which entry is the largest. Actually, 2.22222 and 2.22 would be close enough (2 is usually the widest digit).



documentclass{article}
usepackage[utf8]{inputenc}
usepackage{multirow, adjustbox, mathtools}
begin{document}

begin{table}[htbp]
begin{adjustbox}{width=columnwidth,center}
sbox0{Calculated Difference}%
sbox1{$null=null$}%
sbox2{$text{g}^+text{g}^-$-tt}% left
sbox3{begin{tabular}{@{}l@{}}
1.64338\
3.00859\
0.80709\
1.44622\
2.11342\
0.71435\
0.66765\
1.32002\
0.22408
end{tabular}}% right
dimen0=dimexpr wd2 + wd0 - wd1 - wd3relax
sbox0{Experimental Difference}%
sbox3{begin{tabular}{@{}l@{}}
1.62\
3.51\
0.86
end{tabular}}% right
dimen1=dimexpr wd2 + wd0 - wd1 - wd3relax
begin{tabular}{|c|r@{$null=null$}l|r@{$null=null$}l|r@{$null=null$}l|c|}
hline
Force Field & multicolumn{2}{c|}{Calculated Energy} & multicolumn{2}{c|}{Calculated Difference} & multicolumn{2}{c|}{Experimental Difference} & Error \
hline
multirow{4}{*}{OPLS-AA}
& tt & 2.55447 & multicolumn{2}{c|}{} & multicolumn{2}{c|}{} & \ cline{2-8}
& $text{g}^+text{g}^+$ & 4.19785 & makebox[0.5dimen0][r]{$text{g}^+text{g}^+$-tt} & 1.64338
& makebox[0.5dimen1][r]{$text{g}^+text{g}^+$-tt} & 1.62 & 0.02338 \ cline{2-8}% note makebox
& $text{g}^+text{g}^-$ & 5.56306 & $text{g}^+text{g}^-$-tt & 3.00859 & $text{g}^+text{g}^-$-tt & 3.51 & -0.50141 \ cline{2-8}
& tg & 3.36156 & tg-tt & 0.80709 & tg-tt & 0.86 & -0.05291 \ cline{2-8}
hline

multirow{4}{*}{AM1}
& tt & -37.97281 & multicolumn{2}{c|}{} & multicolumn{2}{c|}{} & \ cline{2-8}
& $text{g}^+text{g}^+$ & -36.52659 & $text{g}^+text{g}^+$-tt & 1.44622 & $text{g}^+text{g}^+$-tt & 1.62 & -0.17378 \ cline{2-8}
& $text{g}^+text{g}^-$ & -35.85939 & $text{g}^+text{g}^-$-tt & 2.11342 & $text{g}^+text{g}^-$-tt & 3.51 & -1.39658 \ cline{2-8}
& tg & -37.25846 & tg-tt & 0.71435 & tg-tt & 0.86 & -0.14565 \ cline{2-8}
hline
multirow{4}{*}{PDDG/PM3}
& tt & -34.61227 & multicolumn{2}{c|}{} & multicolumn{2}{c|}{} & \ cline{2-8}
& $text{g}^+text{g}^+$ & -33.94462 & $text{g}^+text{g}^+$-tt & 0.66765 & $text{g}^+text{g}^+$-tt & 1.62 & -0.95235 \ cline{2-8}
& $text{g}^+text{g}^-$ & -33.29225 & $text{g}^+text{g}^-$-tt & 1.32002 & $text{g}^+text{g}^-$-tt & 3.51 & -2.18998 \ cline{2-8}
& tg & -34.38819 & tg-tt & 0.22408 & tg-tt & 0.86 & -0.63592 \ cline{2-8}
hline
end{tabular}
end{adjustbox}
end{table}

end{document}


demo2






share|improve this answer


























  • Great! Is there a way to maintain the text being centered, like under the "Experimental Difference" column? (I see that you're splitting left/right on the equals sign, so I understand that might not be possible)

    – David
    Mar 22 at 3:16













  • Possible, but you need to locate the largest item to the left of the = and the largest item to the right (not necessarily in the same row). I was hoping centering the = was good enough. After all, siunitx only centers the decimal point.

    – John Kormylo
    Mar 22 at 3:25











  • Ah, I see. Thank you! I'll mark this as solved.

    – David
    Mar 22 at 3:27











  • BTW, - and $-$ are significantly different symbols. Alas, I tend to forget that myself.

    – John Kormylo
    Mar 22 at 16:41


















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














Here is one approach. I split the columns using = into two columns. To get the spacing right (and save typing) I used @{$null=null$} between the columns. Unfortunately, this meant having to use multicolumn every time I didn't want a = to appear.



The only remaining problem was that when the label is too large, the extra space is added to the right half. To fix that, I calculated the difference and added extra space to the left half using makebox. Now the equal signs are centered.



documentclass{article}
usepackage[utf8]{inputenc}
usepackage{multirow, adjustbox, mathtools}
begin{document}

begin{table}[htbp]
begin{adjustbox}{width=columnwidth,center}
sbox0{Calculated Difference}%
sbox1{Experimental Difference}%
sbox2{$null=null$}%
dimen0=dimexpr wd0 - wd2relax
dimen1=dimexpr wd1 - wd2relax
begin{tabular}{|c|r@{$null=null$}l|r@{$null=null$}l|r@{$null=null$}l|c|}
hline
Force Field & multicolumn{2}{c|}{Calculated Energy} & multicolumn{2}{c|}{Calculated Difference} & multicolumn{2}{c|}{Experimental Difference} & Error \
hline
multirow{4}{*}{OPLS-AA}
& tt & 2.55447 & multicolumn{2}{c|}{} & multicolumn{2}{c|}{} & \ cline{2-8}
& $text{g}^+text{g}^+$ & 4.19785 & makebox[0.5dimen0][r]{$text{g}^+text{g}^+$-tt} & 1.64338
& makebox[0.5dimen1][r]{$text{g}^+text{g}^+$-tt} & 1.62 & 0.02338 \ cline{2-8}% note makebox
& $text{g}^+text{g}^-$ & 5.56306 & $text{g}^+text{g}^-$-tt & 3.00859 & $text{g}^+text{g}^-$-tt & 3.51 & -0.50141 \ cline{2-8}
& tg & 3.36156 & tg-tt & 0.80709 & tg-tt & 0.86 & -0.05291 \ cline{2-8}
hline

multirow{4}{*}{AM1}
& tt & -37.97281 & multicolumn{2}{c|}{} & multicolumn{2}{c|}{} & \ cline{2-8}
& $text{g}^+text{g}^+$ & -36.52659 & $text{g}^+text{g}^+$-tt & 1.44622 & $text{g}^+text{g}^+$-tt & 1.62 & -0.17378 \ cline{2-8}
& $text{g}^+text{g}^-$ & -35.85939 & $text{g}^+text{g}^-$-tt & 2.11342 & $text{g}^+text{g}^-$-tt & 3.51 & -1.39658 \ cline{2-8}
& tg & -37.25846 & tg-tt & 0.71435 & tg-tt & 0.86 & -0.14565 \ cline{2-8}
hline
multirow{4}{*}{PDDG/PM3}
& tt & -34.61227 & multicolumn{2}{c|}{} & multicolumn{2}{c|}{} & \ cline{2-8}
& $text{g}^+text{g}^+$ & -33.94462 & $text{g}^+text{g}^+$-tt & 0.66765 & $text{g}^+text{g}^+$-tt & 1.62 & -0.95235 \ cline{2-8}
& $text{g}^+text{g}^-$ & -33.29225 & $text{g}^+text{g}^-$-tt & 1.32002 & $text{g}^+text{g}^-$-tt & 3.51 & -2.18998 \ cline{2-8}
& tg & -34.38819 & tg-tt & 0.22408 & tg-tt & 0.86 & -0.63592 \ cline{2-8}
hline
end{tabular}
end{adjustbox}
end{table}

end{document}


demo





If you really want to center the fields...



Note: I used a tabular in sbox3 mostly to show what you have to do it you are not sure which entry is the largest. Actually, 2.22222 and 2.22 would be close enough (2 is usually the widest digit).



documentclass{article}
usepackage[utf8]{inputenc}
usepackage{multirow, adjustbox, mathtools}
begin{document}

begin{table}[htbp]
begin{adjustbox}{width=columnwidth,center}
sbox0{Calculated Difference}%
sbox1{$null=null$}%
sbox2{$text{g}^+text{g}^-$-tt}% left
sbox3{begin{tabular}{@{}l@{}}
1.64338\
3.00859\
0.80709\
1.44622\
2.11342\
0.71435\
0.66765\
1.32002\
0.22408
end{tabular}}% right
dimen0=dimexpr wd2 + wd0 - wd1 - wd3relax
sbox0{Experimental Difference}%
sbox3{begin{tabular}{@{}l@{}}
1.62\
3.51\
0.86
end{tabular}}% right
dimen1=dimexpr wd2 + wd0 - wd1 - wd3relax
begin{tabular}{|c|r@{$null=null$}l|r@{$null=null$}l|r@{$null=null$}l|c|}
hline
Force Field & multicolumn{2}{c|}{Calculated Energy} & multicolumn{2}{c|}{Calculated Difference} & multicolumn{2}{c|}{Experimental Difference} & Error \
hline
multirow{4}{*}{OPLS-AA}
& tt & 2.55447 & multicolumn{2}{c|}{} & multicolumn{2}{c|}{} & \ cline{2-8}
& $text{g}^+text{g}^+$ & 4.19785 & makebox[0.5dimen0][r]{$text{g}^+text{g}^+$-tt} & 1.64338
& makebox[0.5dimen1][r]{$text{g}^+text{g}^+$-tt} & 1.62 & 0.02338 \ cline{2-8}% note makebox
& $text{g}^+text{g}^-$ & 5.56306 & $text{g}^+text{g}^-$-tt & 3.00859 & $text{g}^+text{g}^-$-tt & 3.51 & -0.50141 \ cline{2-8}
& tg & 3.36156 & tg-tt & 0.80709 & tg-tt & 0.86 & -0.05291 \ cline{2-8}
hline

multirow{4}{*}{AM1}
& tt & -37.97281 & multicolumn{2}{c|}{} & multicolumn{2}{c|}{} & \ cline{2-8}
& $text{g}^+text{g}^+$ & -36.52659 & $text{g}^+text{g}^+$-tt & 1.44622 & $text{g}^+text{g}^+$-tt & 1.62 & -0.17378 \ cline{2-8}
& $text{g}^+text{g}^-$ & -35.85939 & $text{g}^+text{g}^-$-tt & 2.11342 & $text{g}^+text{g}^-$-tt & 3.51 & -1.39658 \ cline{2-8}
& tg & -37.25846 & tg-tt & 0.71435 & tg-tt & 0.86 & -0.14565 \ cline{2-8}
hline
multirow{4}{*}{PDDG/PM3}
& tt & -34.61227 & multicolumn{2}{c|}{} & multicolumn{2}{c|}{} & \ cline{2-8}
& $text{g}^+text{g}^+$ & -33.94462 & $text{g}^+text{g}^+$-tt & 0.66765 & $text{g}^+text{g}^+$-tt & 1.62 & -0.95235 \ cline{2-8}
& $text{g}^+text{g}^-$ & -33.29225 & $text{g}^+text{g}^-$-tt & 1.32002 & $text{g}^+text{g}^-$-tt & 3.51 & -2.18998 \ cline{2-8}
& tg & -34.38819 & tg-tt & 0.22408 & tg-tt & 0.86 & -0.63592 \ cline{2-8}
hline
end{tabular}
end{adjustbox}
end{table}

end{document}


demo2






share|improve this answer


























  • Great! Is there a way to maintain the text being centered, like under the "Experimental Difference" column? (I see that you're splitting left/right on the equals sign, so I understand that might not be possible)

    – David
    Mar 22 at 3:16













  • Possible, but you need to locate the largest item to the left of the = and the largest item to the right (not necessarily in the same row). I was hoping centering the = was good enough. After all, siunitx only centers the decimal point.

    – John Kormylo
    Mar 22 at 3:25











  • Ah, I see. Thank you! I'll mark this as solved.

    – David
    Mar 22 at 3:27











  • BTW, - and $-$ are significantly different symbols. Alas, I tend to forget that myself.

    – John Kormylo
    Mar 22 at 16:41
















1














Here is one approach. I split the columns using = into two columns. To get the spacing right (and save typing) I used @{$null=null$} between the columns. Unfortunately, this meant having to use multicolumn every time I didn't want a = to appear.



The only remaining problem was that when the label is too large, the extra space is added to the right half. To fix that, I calculated the difference and added extra space to the left half using makebox. Now the equal signs are centered.



documentclass{article}
usepackage[utf8]{inputenc}
usepackage{multirow, adjustbox, mathtools}
begin{document}

begin{table}[htbp]
begin{adjustbox}{width=columnwidth,center}
sbox0{Calculated Difference}%
sbox1{Experimental Difference}%
sbox2{$null=null$}%
dimen0=dimexpr wd0 - wd2relax
dimen1=dimexpr wd1 - wd2relax
begin{tabular}{|c|r@{$null=null$}l|r@{$null=null$}l|r@{$null=null$}l|c|}
hline
Force Field & multicolumn{2}{c|}{Calculated Energy} & multicolumn{2}{c|}{Calculated Difference} & multicolumn{2}{c|}{Experimental Difference} & Error \
hline
multirow{4}{*}{OPLS-AA}
& tt & 2.55447 & multicolumn{2}{c|}{} & multicolumn{2}{c|}{} & \ cline{2-8}
& $text{g}^+text{g}^+$ & 4.19785 & makebox[0.5dimen0][r]{$text{g}^+text{g}^+$-tt} & 1.64338
& makebox[0.5dimen1][r]{$text{g}^+text{g}^+$-tt} & 1.62 & 0.02338 \ cline{2-8}% note makebox
& $text{g}^+text{g}^-$ & 5.56306 & $text{g}^+text{g}^-$-tt & 3.00859 & $text{g}^+text{g}^-$-tt & 3.51 & -0.50141 \ cline{2-8}
& tg & 3.36156 & tg-tt & 0.80709 & tg-tt & 0.86 & -0.05291 \ cline{2-8}
hline

multirow{4}{*}{AM1}
& tt & -37.97281 & multicolumn{2}{c|}{} & multicolumn{2}{c|}{} & \ cline{2-8}
& $text{g}^+text{g}^+$ & -36.52659 & $text{g}^+text{g}^+$-tt & 1.44622 & $text{g}^+text{g}^+$-tt & 1.62 & -0.17378 \ cline{2-8}
& $text{g}^+text{g}^-$ & -35.85939 & $text{g}^+text{g}^-$-tt & 2.11342 & $text{g}^+text{g}^-$-tt & 3.51 & -1.39658 \ cline{2-8}
& tg & -37.25846 & tg-tt & 0.71435 & tg-tt & 0.86 & -0.14565 \ cline{2-8}
hline
multirow{4}{*}{PDDG/PM3}
& tt & -34.61227 & multicolumn{2}{c|}{} & multicolumn{2}{c|}{} & \ cline{2-8}
& $text{g}^+text{g}^+$ & -33.94462 & $text{g}^+text{g}^+$-tt & 0.66765 & $text{g}^+text{g}^+$-tt & 1.62 & -0.95235 \ cline{2-8}
& $text{g}^+text{g}^-$ & -33.29225 & $text{g}^+text{g}^-$-tt & 1.32002 & $text{g}^+text{g}^-$-tt & 3.51 & -2.18998 \ cline{2-8}
& tg & -34.38819 & tg-tt & 0.22408 & tg-tt & 0.86 & -0.63592 \ cline{2-8}
hline
end{tabular}
end{adjustbox}
end{table}

end{document}


demo





If you really want to center the fields...



Note: I used a tabular in sbox3 mostly to show what you have to do it you are not sure which entry is the largest. Actually, 2.22222 and 2.22 would be close enough (2 is usually the widest digit).



documentclass{article}
usepackage[utf8]{inputenc}
usepackage{multirow, adjustbox, mathtools}
begin{document}

begin{table}[htbp]
begin{adjustbox}{width=columnwidth,center}
sbox0{Calculated Difference}%
sbox1{$null=null$}%
sbox2{$text{g}^+text{g}^-$-tt}% left
sbox3{begin{tabular}{@{}l@{}}
1.64338\
3.00859\
0.80709\
1.44622\
2.11342\
0.71435\
0.66765\
1.32002\
0.22408
end{tabular}}% right
dimen0=dimexpr wd2 + wd0 - wd1 - wd3relax
sbox0{Experimental Difference}%
sbox3{begin{tabular}{@{}l@{}}
1.62\
3.51\
0.86
end{tabular}}% right
dimen1=dimexpr wd2 + wd0 - wd1 - wd3relax
begin{tabular}{|c|r@{$null=null$}l|r@{$null=null$}l|r@{$null=null$}l|c|}
hline
Force Field & multicolumn{2}{c|}{Calculated Energy} & multicolumn{2}{c|}{Calculated Difference} & multicolumn{2}{c|}{Experimental Difference} & Error \
hline
multirow{4}{*}{OPLS-AA}
& tt & 2.55447 & multicolumn{2}{c|}{} & multicolumn{2}{c|}{} & \ cline{2-8}
& $text{g}^+text{g}^+$ & 4.19785 & makebox[0.5dimen0][r]{$text{g}^+text{g}^+$-tt} & 1.64338
& makebox[0.5dimen1][r]{$text{g}^+text{g}^+$-tt} & 1.62 & 0.02338 \ cline{2-8}% note makebox
& $text{g}^+text{g}^-$ & 5.56306 & $text{g}^+text{g}^-$-tt & 3.00859 & $text{g}^+text{g}^-$-tt & 3.51 & -0.50141 \ cline{2-8}
& tg & 3.36156 & tg-tt & 0.80709 & tg-tt & 0.86 & -0.05291 \ cline{2-8}
hline

multirow{4}{*}{AM1}
& tt & -37.97281 & multicolumn{2}{c|}{} & multicolumn{2}{c|}{} & \ cline{2-8}
& $text{g}^+text{g}^+$ & -36.52659 & $text{g}^+text{g}^+$-tt & 1.44622 & $text{g}^+text{g}^+$-tt & 1.62 & -0.17378 \ cline{2-8}
& $text{g}^+text{g}^-$ & -35.85939 & $text{g}^+text{g}^-$-tt & 2.11342 & $text{g}^+text{g}^-$-tt & 3.51 & -1.39658 \ cline{2-8}
& tg & -37.25846 & tg-tt & 0.71435 & tg-tt & 0.86 & -0.14565 \ cline{2-8}
hline
multirow{4}{*}{PDDG/PM3}
& tt & -34.61227 & multicolumn{2}{c|}{} & multicolumn{2}{c|}{} & \ cline{2-8}
& $text{g}^+text{g}^+$ & -33.94462 & $text{g}^+text{g}^+$-tt & 0.66765 & $text{g}^+text{g}^+$-tt & 1.62 & -0.95235 \ cline{2-8}
& $text{g}^+text{g}^-$ & -33.29225 & $text{g}^+text{g}^-$-tt & 1.32002 & $text{g}^+text{g}^-$-tt & 3.51 & -2.18998 \ cline{2-8}
& tg & -34.38819 & tg-tt & 0.22408 & tg-tt & 0.86 & -0.63592 \ cline{2-8}
hline
end{tabular}
end{adjustbox}
end{table}

end{document}


demo2






share|improve this answer


























  • Great! Is there a way to maintain the text being centered, like under the "Experimental Difference" column? (I see that you're splitting left/right on the equals sign, so I understand that might not be possible)

    – David
    Mar 22 at 3:16













  • Possible, but you need to locate the largest item to the left of the = and the largest item to the right (not necessarily in the same row). I was hoping centering the = was good enough. After all, siunitx only centers the decimal point.

    – John Kormylo
    Mar 22 at 3:25











  • Ah, I see. Thank you! I'll mark this as solved.

    – David
    Mar 22 at 3:27











  • BTW, - and $-$ are significantly different symbols. Alas, I tend to forget that myself.

    – John Kormylo
    Mar 22 at 16:41














1












1








1







Here is one approach. I split the columns using = into two columns. To get the spacing right (and save typing) I used @{$null=null$} between the columns. Unfortunately, this meant having to use multicolumn every time I didn't want a = to appear.



The only remaining problem was that when the label is too large, the extra space is added to the right half. To fix that, I calculated the difference and added extra space to the left half using makebox. Now the equal signs are centered.



documentclass{article}
usepackage[utf8]{inputenc}
usepackage{multirow, adjustbox, mathtools}
begin{document}

begin{table}[htbp]
begin{adjustbox}{width=columnwidth,center}
sbox0{Calculated Difference}%
sbox1{Experimental Difference}%
sbox2{$null=null$}%
dimen0=dimexpr wd0 - wd2relax
dimen1=dimexpr wd1 - wd2relax
begin{tabular}{|c|r@{$null=null$}l|r@{$null=null$}l|r@{$null=null$}l|c|}
hline
Force Field & multicolumn{2}{c|}{Calculated Energy} & multicolumn{2}{c|}{Calculated Difference} & multicolumn{2}{c|}{Experimental Difference} & Error \
hline
multirow{4}{*}{OPLS-AA}
& tt & 2.55447 & multicolumn{2}{c|}{} & multicolumn{2}{c|}{} & \ cline{2-8}
& $text{g}^+text{g}^+$ & 4.19785 & makebox[0.5dimen0][r]{$text{g}^+text{g}^+$-tt} & 1.64338
& makebox[0.5dimen1][r]{$text{g}^+text{g}^+$-tt} & 1.62 & 0.02338 \ cline{2-8}% note makebox
& $text{g}^+text{g}^-$ & 5.56306 & $text{g}^+text{g}^-$-tt & 3.00859 & $text{g}^+text{g}^-$-tt & 3.51 & -0.50141 \ cline{2-8}
& tg & 3.36156 & tg-tt & 0.80709 & tg-tt & 0.86 & -0.05291 \ cline{2-8}
hline

multirow{4}{*}{AM1}
& tt & -37.97281 & multicolumn{2}{c|}{} & multicolumn{2}{c|}{} & \ cline{2-8}
& $text{g}^+text{g}^+$ & -36.52659 & $text{g}^+text{g}^+$-tt & 1.44622 & $text{g}^+text{g}^+$-tt & 1.62 & -0.17378 \ cline{2-8}
& $text{g}^+text{g}^-$ & -35.85939 & $text{g}^+text{g}^-$-tt & 2.11342 & $text{g}^+text{g}^-$-tt & 3.51 & -1.39658 \ cline{2-8}
& tg & -37.25846 & tg-tt & 0.71435 & tg-tt & 0.86 & -0.14565 \ cline{2-8}
hline
multirow{4}{*}{PDDG/PM3}
& tt & -34.61227 & multicolumn{2}{c|}{} & multicolumn{2}{c|}{} & \ cline{2-8}
& $text{g}^+text{g}^+$ & -33.94462 & $text{g}^+text{g}^+$-tt & 0.66765 & $text{g}^+text{g}^+$-tt & 1.62 & -0.95235 \ cline{2-8}
& $text{g}^+text{g}^-$ & -33.29225 & $text{g}^+text{g}^-$-tt & 1.32002 & $text{g}^+text{g}^-$-tt & 3.51 & -2.18998 \ cline{2-8}
& tg & -34.38819 & tg-tt & 0.22408 & tg-tt & 0.86 & -0.63592 \ cline{2-8}
hline
end{tabular}
end{adjustbox}
end{table}

end{document}


demo





If you really want to center the fields...



Note: I used a tabular in sbox3 mostly to show what you have to do it you are not sure which entry is the largest. Actually, 2.22222 and 2.22 would be close enough (2 is usually the widest digit).



documentclass{article}
usepackage[utf8]{inputenc}
usepackage{multirow, adjustbox, mathtools}
begin{document}

begin{table}[htbp]
begin{adjustbox}{width=columnwidth,center}
sbox0{Calculated Difference}%
sbox1{$null=null$}%
sbox2{$text{g}^+text{g}^-$-tt}% left
sbox3{begin{tabular}{@{}l@{}}
1.64338\
3.00859\
0.80709\
1.44622\
2.11342\
0.71435\
0.66765\
1.32002\
0.22408
end{tabular}}% right
dimen0=dimexpr wd2 + wd0 - wd1 - wd3relax
sbox0{Experimental Difference}%
sbox3{begin{tabular}{@{}l@{}}
1.62\
3.51\
0.86
end{tabular}}% right
dimen1=dimexpr wd2 + wd0 - wd1 - wd3relax
begin{tabular}{|c|r@{$null=null$}l|r@{$null=null$}l|r@{$null=null$}l|c|}
hline
Force Field & multicolumn{2}{c|}{Calculated Energy} & multicolumn{2}{c|}{Calculated Difference} & multicolumn{2}{c|}{Experimental Difference} & Error \
hline
multirow{4}{*}{OPLS-AA}
& tt & 2.55447 & multicolumn{2}{c|}{} & multicolumn{2}{c|}{} & \ cline{2-8}
& $text{g}^+text{g}^+$ & 4.19785 & makebox[0.5dimen0][r]{$text{g}^+text{g}^+$-tt} & 1.64338
& makebox[0.5dimen1][r]{$text{g}^+text{g}^+$-tt} & 1.62 & 0.02338 \ cline{2-8}% note makebox
& $text{g}^+text{g}^-$ & 5.56306 & $text{g}^+text{g}^-$-tt & 3.00859 & $text{g}^+text{g}^-$-tt & 3.51 & -0.50141 \ cline{2-8}
& tg & 3.36156 & tg-tt & 0.80709 & tg-tt & 0.86 & -0.05291 \ cline{2-8}
hline

multirow{4}{*}{AM1}
& tt & -37.97281 & multicolumn{2}{c|}{} & multicolumn{2}{c|}{} & \ cline{2-8}
& $text{g}^+text{g}^+$ & -36.52659 & $text{g}^+text{g}^+$-tt & 1.44622 & $text{g}^+text{g}^+$-tt & 1.62 & -0.17378 \ cline{2-8}
& $text{g}^+text{g}^-$ & -35.85939 & $text{g}^+text{g}^-$-tt & 2.11342 & $text{g}^+text{g}^-$-tt & 3.51 & -1.39658 \ cline{2-8}
& tg & -37.25846 & tg-tt & 0.71435 & tg-tt & 0.86 & -0.14565 \ cline{2-8}
hline
multirow{4}{*}{PDDG/PM3}
& tt & -34.61227 & multicolumn{2}{c|}{} & multicolumn{2}{c|}{} & \ cline{2-8}
& $text{g}^+text{g}^+$ & -33.94462 & $text{g}^+text{g}^+$-tt & 0.66765 & $text{g}^+text{g}^+$-tt & 1.62 & -0.95235 \ cline{2-8}
& $text{g}^+text{g}^-$ & -33.29225 & $text{g}^+text{g}^-$-tt & 1.32002 & $text{g}^+text{g}^-$-tt & 3.51 & -2.18998 \ cline{2-8}
& tg & -34.38819 & tg-tt & 0.22408 & tg-tt & 0.86 & -0.63592 \ cline{2-8}
hline
end{tabular}
end{adjustbox}
end{table}

end{document}


demo2






share|improve this answer















Here is one approach. I split the columns using = into two columns. To get the spacing right (and save typing) I used @{$null=null$} between the columns. Unfortunately, this meant having to use multicolumn every time I didn't want a = to appear.



The only remaining problem was that when the label is too large, the extra space is added to the right half. To fix that, I calculated the difference and added extra space to the left half using makebox. Now the equal signs are centered.



documentclass{article}
usepackage[utf8]{inputenc}
usepackage{multirow, adjustbox, mathtools}
begin{document}

begin{table}[htbp]
begin{adjustbox}{width=columnwidth,center}
sbox0{Calculated Difference}%
sbox1{Experimental Difference}%
sbox2{$null=null$}%
dimen0=dimexpr wd0 - wd2relax
dimen1=dimexpr wd1 - wd2relax
begin{tabular}{|c|r@{$null=null$}l|r@{$null=null$}l|r@{$null=null$}l|c|}
hline
Force Field & multicolumn{2}{c|}{Calculated Energy} & multicolumn{2}{c|}{Calculated Difference} & multicolumn{2}{c|}{Experimental Difference} & Error \
hline
multirow{4}{*}{OPLS-AA}
& tt & 2.55447 & multicolumn{2}{c|}{} & multicolumn{2}{c|}{} & \ cline{2-8}
& $text{g}^+text{g}^+$ & 4.19785 & makebox[0.5dimen0][r]{$text{g}^+text{g}^+$-tt} & 1.64338
& makebox[0.5dimen1][r]{$text{g}^+text{g}^+$-tt} & 1.62 & 0.02338 \ cline{2-8}% note makebox
& $text{g}^+text{g}^-$ & 5.56306 & $text{g}^+text{g}^-$-tt & 3.00859 & $text{g}^+text{g}^-$-tt & 3.51 & -0.50141 \ cline{2-8}
& tg & 3.36156 & tg-tt & 0.80709 & tg-tt & 0.86 & -0.05291 \ cline{2-8}
hline

multirow{4}{*}{AM1}
& tt & -37.97281 & multicolumn{2}{c|}{} & multicolumn{2}{c|}{} & \ cline{2-8}
& $text{g}^+text{g}^+$ & -36.52659 & $text{g}^+text{g}^+$-tt & 1.44622 & $text{g}^+text{g}^+$-tt & 1.62 & -0.17378 \ cline{2-8}
& $text{g}^+text{g}^-$ & -35.85939 & $text{g}^+text{g}^-$-tt & 2.11342 & $text{g}^+text{g}^-$-tt & 3.51 & -1.39658 \ cline{2-8}
& tg & -37.25846 & tg-tt & 0.71435 & tg-tt & 0.86 & -0.14565 \ cline{2-8}
hline
multirow{4}{*}{PDDG/PM3}
& tt & -34.61227 & multicolumn{2}{c|}{} & multicolumn{2}{c|}{} & \ cline{2-8}
& $text{g}^+text{g}^+$ & -33.94462 & $text{g}^+text{g}^+$-tt & 0.66765 & $text{g}^+text{g}^+$-tt & 1.62 & -0.95235 \ cline{2-8}
& $text{g}^+text{g}^-$ & -33.29225 & $text{g}^+text{g}^-$-tt & 1.32002 & $text{g}^+text{g}^-$-tt & 3.51 & -2.18998 \ cline{2-8}
& tg & -34.38819 & tg-tt & 0.22408 & tg-tt & 0.86 & -0.63592 \ cline{2-8}
hline
end{tabular}
end{adjustbox}
end{table}

end{document}


demo





If you really want to center the fields...



Note: I used a tabular in sbox3 mostly to show what you have to do it you are not sure which entry is the largest. Actually, 2.22222 and 2.22 would be close enough (2 is usually the widest digit).



documentclass{article}
usepackage[utf8]{inputenc}
usepackage{multirow, adjustbox, mathtools}
begin{document}

begin{table}[htbp]
begin{adjustbox}{width=columnwidth,center}
sbox0{Calculated Difference}%
sbox1{$null=null$}%
sbox2{$text{g}^+text{g}^-$-tt}% left
sbox3{begin{tabular}{@{}l@{}}
1.64338\
3.00859\
0.80709\
1.44622\
2.11342\
0.71435\
0.66765\
1.32002\
0.22408
end{tabular}}% right
dimen0=dimexpr wd2 + wd0 - wd1 - wd3relax
sbox0{Experimental Difference}%
sbox3{begin{tabular}{@{}l@{}}
1.62\
3.51\
0.86
end{tabular}}% right
dimen1=dimexpr wd2 + wd0 - wd1 - wd3relax
begin{tabular}{|c|r@{$null=null$}l|r@{$null=null$}l|r@{$null=null$}l|c|}
hline
Force Field & multicolumn{2}{c|}{Calculated Energy} & multicolumn{2}{c|}{Calculated Difference} & multicolumn{2}{c|}{Experimental Difference} & Error \
hline
multirow{4}{*}{OPLS-AA}
& tt & 2.55447 & multicolumn{2}{c|}{} & multicolumn{2}{c|}{} & \ cline{2-8}
& $text{g}^+text{g}^+$ & 4.19785 & makebox[0.5dimen0][r]{$text{g}^+text{g}^+$-tt} & 1.64338
& makebox[0.5dimen1][r]{$text{g}^+text{g}^+$-tt} & 1.62 & 0.02338 \ cline{2-8}% note makebox
& $text{g}^+text{g}^-$ & 5.56306 & $text{g}^+text{g}^-$-tt & 3.00859 & $text{g}^+text{g}^-$-tt & 3.51 & -0.50141 \ cline{2-8}
& tg & 3.36156 & tg-tt & 0.80709 & tg-tt & 0.86 & -0.05291 \ cline{2-8}
hline

multirow{4}{*}{AM1}
& tt & -37.97281 & multicolumn{2}{c|}{} & multicolumn{2}{c|}{} & \ cline{2-8}
& $text{g}^+text{g}^+$ & -36.52659 & $text{g}^+text{g}^+$-tt & 1.44622 & $text{g}^+text{g}^+$-tt & 1.62 & -0.17378 \ cline{2-8}
& $text{g}^+text{g}^-$ & -35.85939 & $text{g}^+text{g}^-$-tt & 2.11342 & $text{g}^+text{g}^-$-tt & 3.51 & -1.39658 \ cline{2-8}
& tg & -37.25846 & tg-tt & 0.71435 & tg-tt & 0.86 & -0.14565 \ cline{2-8}
hline
multirow{4}{*}{PDDG/PM3}
& tt & -34.61227 & multicolumn{2}{c|}{} & multicolumn{2}{c|}{} & \ cline{2-8}
& $text{g}^+text{g}^+$ & -33.94462 & $text{g}^+text{g}^+$-tt & 0.66765 & $text{g}^+text{g}^+$-tt & 1.62 & -0.95235 \ cline{2-8}
& $text{g}^+text{g}^-$ & -33.29225 & $text{g}^+text{g}^-$-tt & 1.32002 & $text{g}^+text{g}^-$-tt & 3.51 & -2.18998 \ cline{2-8}
& tg & -34.38819 & tg-tt & 0.22408 & tg-tt & 0.86 & -0.63592 \ cline{2-8}
hline
end{tabular}
end{adjustbox}
end{table}

end{document}


demo2







share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 22 at 16:28

























answered Mar 22 at 2:48









John KormyloJohn Kormylo

46.3k22672




46.3k22672













  • Great! Is there a way to maintain the text being centered, like under the "Experimental Difference" column? (I see that you're splitting left/right on the equals sign, so I understand that might not be possible)

    – David
    Mar 22 at 3:16













  • Possible, but you need to locate the largest item to the left of the = and the largest item to the right (not necessarily in the same row). I was hoping centering the = was good enough. After all, siunitx only centers the decimal point.

    – John Kormylo
    Mar 22 at 3:25











  • Ah, I see. Thank you! I'll mark this as solved.

    – David
    Mar 22 at 3:27











  • BTW, - and $-$ are significantly different symbols. Alas, I tend to forget that myself.

    – John Kormylo
    Mar 22 at 16:41



















  • Great! Is there a way to maintain the text being centered, like under the "Experimental Difference" column? (I see that you're splitting left/right on the equals sign, so I understand that might not be possible)

    – David
    Mar 22 at 3:16













  • Possible, but you need to locate the largest item to the left of the = and the largest item to the right (not necessarily in the same row). I was hoping centering the = was good enough. After all, siunitx only centers the decimal point.

    – John Kormylo
    Mar 22 at 3:25











  • Ah, I see. Thank you! I'll mark this as solved.

    – David
    Mar 22 at 3:27











  • BTW, - and $-$ are significantly different symbols. Alas, I tend to forget that myself.

    – John Kormylo
    Mar 22 at 16:41

















Great! Is there a way to maintain the text being centered, like under the "Experimental Difference" column? (I see that you're splitting left/right on the equals sign, so I understand that might not be possible)

– David
Mar 22 at 3:16







Great! Is there a way to maintain the text being centered, like under the "Experimental Difference" column? (I see that you're splitting left/right on the equals sign, so I understand that might not be possible)

– David
Mar 22 at 3:16















Possible, but you need to locate the largest item to the left of the = and the largest item to the right (not necessarily in the same row). I was hoping centering the = was good enough. After all, siunitx only centers the decimal point.

– John Kormylo
Mar 22 at 3:25





Possible, but you need to locate the largest item to the left of the = and the largest item to the right (not necessarily in the same row). I was hoping centering the = was good enough. After all, siunitx only centers the decimal point.

– John Kormylo
Mar 22 at 3:25













Ah, I see. Thank you! I'll mark this as solved.

– David
Mar 22 at 3:27





Ah, I see. Thank you! I'll mark this as solved.

– David
Mar 22 at 3:27













BTW, - and $-$ are significantly different symbols. Alas, I tend to forget that myself.

– John Kormylo
Mar 22 at 16:41





BTW, - and $-$ are significantly different symbols. Alas, I tend to forget that myself.

– John Kormylo
Mar 22 at 16:41



Popular posts from this blog

Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

ComboBox Display Member on multiple fields

Is it possible to collect Nectar points via Trainline?