vertically central aligning the table cell contents
In order to vertically center the contents in the rows, replace p
by m
. In the second table, I have also applied a ragged right alignment to get rid of the large horizontal white spaces.
\documentclass{article}
\usepackage{array}
\usepackage{ragged2e}
\begin{document}
\begin{table}[h!]
\centering
\begin{tabular}{ | m{3cm} | m{1cm} | c | c | c | c | c | c | }
\hline
Parameter & Units & \multicolumn{6}{c|}{Values} \\
\hline
Channel Bandwidth & MHz & 1.25 & 2.5
& 5 & 10 & 15 & 20 \\
\hline
Frame duration & ms & \multicolumn{6}{c|}{10} \\
\hline
Sub-frame duration & ms & \multicolumn{6}{c|}{1} \\
\hline
Sub-carrier spacing & kHz & \multicolumn{6}{c|}{15} \\
\hline
Sampling Frequency & MHz & 1.92 & 3.84 & 7.68 & 15.36 & 23.04 & 30.72 \\
\hline
\end{tabular}
\end{table}
\begin{table}[h!]
\centering
\begin{tabular}{ | >{\RaggedRight}m{3cm} | c | c | c | c | c | c | c | }
\hline
Parameter & Units & \multicolumn{6}{c|}{Values} \\
\hline
Channel Bandwidth & MHz & 1.25 & 2.5
& 5 & 10 & 15 & 20 \\
\hline
Frame duration & ms & \multicolumn{6}{c|}{10} \\
\hline
Sub-frame duration & ms & \multicolumn{6}{c|}{1} \\
\hline
Sub-carrier spacing & kHz & \multicolumn{6}{c|}{15} \\
\hline
Sampling Frequency & MHz & 1.92 & 3.84 & 7.68 & 15.36 & 23.04 & 30.72 \\
\hline
\end{tabular}
\end{table}
\end{document}
Personally, I'd use an l
type column for the first (and second) column and remove all of the vertical and most of the horizontal lines. Maybe you could also put the values of frame duration, sub-frame duration and sub-carrier spacing, that seem to be the same regardless of the channel bandwidth, into the caption of the table.
I think the main issue with your table is that the six numeric columns are not equally wide, and hence that the numbers 10, 1, and 15 are not placed in the middle of the space. To remedy this, I suggest you use a tabularx
environment and use a centered version of the X
column type for the six numeric columns. Conversely, I also suggest you use the basic l
column type for the first two columns.
You should also replace all four instances of
\multicolumn{6}{|c|}{...}
with
\multicolumn{6}{c|}{...}
in order to avoid creating double-width vertical lines.
\documentclass{article}
\usepackage{tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\begin{document}
\begin{table}[h!]
\setlength\extrarowheight{2pt}
\setlength\tabcolsep{4pt}
\begin{tabularx}{\textwidth}{ | l | l | *{6}{C|} }
\hline
Parameter & Units& \multicolumn{6}{c|}{Values} \\
\hline
Channel Bandwidth & MHz & 1.25 & 2.5 & 5 & 10 & 15 & 20 \\
\hline
Frame duration & ms & \multicolumn{6}{c|}{10} \\
\hline
Sub-frame duration & ms & \multicolumn{6}{c|}{\phantom{0}1} \\
\hline
Sub-carrier spacing & kHz & \multicolumn{6}{c|}{15} \\
\hline
Sampling Frequency & MHz & 1.92 & 3.84 & 7.68 & 15.36 & 23.04 & 30.72 \\
\hline
\end{tabularx}
\end{table}
\end{document}