How to left align text in a table with \makecell

You just have to write \makecell[l]{…} if you want to left-align (it is vertically and horizontally centred by default).

However, rather than using \resizebox I would suggest one of these two solutions, based on \tabularx and cellspace (for some vertical padding between rows). Makecell is not necessary. Also I loaded caption for a better vertical spacing between caption and table:

\documentclass{article}
\usepackage{array, tabularx, caption, boldline}
\usepackage{graphicx}
\usepackage{cellspace}
\setlength\cellspacetoplimit{4pt}
\setlength\cellspacebottomlimit{4pt}

\begin{document}

\begin{table}[h!]
  \caption{Main Notations}
  \label{tab:table1}\centering
  \begin{tabularx}{9cm}{|Sl|X|}
    \hline
    \textbf{Notation} & \textbf{Meaning} \\
    \hline
    $P_{md}$ & local probability of misdetection \\
    \hline
    $P_{d}$ & local probability of detection \\
    \hline
    $P_{fa}$ & probability of false alarm \\
    \hline
    $P_{pu}$ & signal \\
    \hline
    $P_b$ & broadcast \\
    \hline
    $N_{gd}$ & node 1 \\
    \hline
    $N_{ln}$ & Total number of node \\
    \hline
    $h_{gd1}$ & {h number when majority of the nodes in a topology gives a decision `1' when PU is present} \\
    \hline
  \end{tabularx}
\end{table}

\begin{table}[h!]
  \caption{Main Notations}
  \label{tab:table2}\centering
  \begin{tabularx}{9cm}{SlV{2}X}
    \textbf{Notation} & \textbf{Meaning} \\
    \hlineB{1.2}
    $P_{md}$ & local probability of misdetection \\
    $P_{d}$ & local probability of detection \\
    $P_{fa}$ & probability of false alarm \\
    $P_{pu}$ & signal \\
    $P_b$ & broadcast \\
    $N_{gd}$ & node 1 \\
    $N_{ln}$ & Total number of node \\
    $h_{gd1}$ & {h number when majority of the nodes in a topology gives a decision `1' when PU is present}
  \end{tabularx}
\end{table}

\end{document} 

enter image description here


I would like to suggest that you go for a table with an "open" look, by getting rid of all vertical rules, most horizontal rules, and using the rule-drawing macros of the booktabs package -- \toprule, \midrule, and \bottomrule -- for the remaining horizontal lines. Rather than using \resizebox to achieve a table width of 9cm, I suggest you use a tabularx environment, whose overall width can be set to the desired width (here: 9cm) directly.

enter image description here

\documentclass{article}

\usepackage{tabularx,booktabs,caption,ragged2e}
\newcolumntype{Y}{>{\RaggedRight\arraybackslash}X}

\begin{document}

\begin{table}[h!]
\centering
\caption{Main Notations}
\label{tab:table1}
\begin{tabularx}{9cm}{@{} lY @{}}
\toprule
\textbf{Notation} & \textbf{Meaning} \\
\midrule
$P_{md}$ & local probability of misdetection \\
$P_{d}$  & local probability of detection \\
$P_{fa}$ & probability of false alarm \\
$P_{pu}$ & signal \\
$P_b$    & broadcast \\
$N_{gd}$ & node 1  \\
$N_{ln}$ & Total number of nodes \\
$h_{gd1}$& $h$ number when majority of nodes in a topology 
           gives decision ``1'' when PU is present \\ 
\bottomrule
\end{tabularx}
\end{table}

\end{document}

Tags:

Tables