I want to center the text in a table code given below in first column only just like the other two columns created by multi column centered the heading Dispersion Constant (R). I want the Algorithm heading in first column of table to be centered just like the Dispersion Constant (R) . The result of following code is given in figure below. Keep in mind I just want Algorithm to be centered not the content below(SCA,MCMA,etc) the Algorithm Heading. Thank You. Please help?
\begin{table}[h]
\centering
\caption{Dispersion Constant $(R)$ Values}
\begin{tabular}{|l|l|l|}
\hline
\centering
\textbf{Algorithm} & \multicolumn{2}{|c|}{\textbf{Dispersion Constant $(R)$}}\\
\hline
& \textbf{M=16} & \textbf{M=32}\\ \hline
SCA & R\textsubscript{SCA} = 123 & R\textsubscript{SCA} = 123 \\\hline
MCMA & R\textsubscript{MCMA} = 123 & R\textsubscript{MCMA} = 123\\\hline
MCMA(Dual Mode) & R\textsubscript{MCMA}& R\textsubscript{MCMA}\\\hline
DD-MCMA & R\textsubscript{DD-MCMA} = 123 & R\textsubscript{DD-MCMA} = 123\\\hline
DD-MCMA(Dual Mode) & R\textsubscript{DD-MCMA}& R\textsubscript{DD-MCMA}\\\hline
\end{tabular}
\end{table}
Best Answer
If you absolutely must employ the "prison look" for tables, but wish to lessen the visual oppressiveness, consider getting rid of the
\hline
directives in the body of thetabular
material. And, load thearray
package and set\extrarowheight
to a small non-zero length value. :-)You should also make an effort to give the term "R" ("dispersion value") a consistent appearance. In your code, it shows up in math italics in the table's header but in upright ("Roman") in the body of the table. Do make the appearance of this variable name consistent. In the code below, I show how to make use of the math-italics method. And, while we're talking about consistency, I've made the
M
term employ (bold) math italics as well.Finally, to center some material in a single cell of the first column, use a
\multicolumn{1}{|c|}{...}
"wrapper".