1

Any way to center "ID" on the table below?

\begin{tabular}{|l|c|c|}
\hline
             \centering{ID}          & \multicolumn{2}{c|}{\textbf{RM1}}                      \\ \hline
                                     & $\Delta G^\circ_{cosmo}$ & $\Delta G^\circ_{cosmo-SS}$ \\ \hline
CCref                                &                          &                             \\ \hline
\end{tabular}

I tried \centering{ID} but it doesn't work. Also tried \centerline but doesn't work.

  • 1
    Just use \multicolumn{1}{|c|}{ID} – Mico Sep 8 '17 at 21:22
  • 1
    also _{cosmo} should be _{\textrm{cosmo}} – David Carlisle Sep 8 '17 at 21:23
  • @Mico good. Post it as an answer, or I can remove the question if it is too stupid – user134500 Sep 8 '17 at 21:23
  • @DavidCarlisle oh you are right, thanks. I must change all the tables. I will try with ctrl H – user134500 Sep 8 '17 at 21:24
5

I suggest you write

\multicolumn{1}{|c|}{ID}

By the way, \centering is a switch and doesn't take an argument.

A full MWE:

\documentclass{article}
\usepackage{amsmath} % for appropriate sizing of \textrm
\begin{document}
\begin{tabular}{|l|c|c|}
\hline
\multicolumn{1}{|c|}{ID} & \multicolumn{2}{c|}{\textbf{RM1}}                      \\ 
\hline
       & $\Delta G^\circ_{\textrm{cosmo}}$ % per David C.'s suggestion
       & $\Delta G^\circ_{\textrm{cosmo-SS}}$ \\ \hline
CCref  &  &  \\ \hline
\end{tabular}
\end{document}
  • 1
    great, thanks Mico. I will accept in 6 minutes ;) – user134500 Sep 8 '17 at 21:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy