0

I need a table to be displayed as below enter image description here

The code for the table that I have written is :

 \documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin {table}[htbp]
\label{table:3.6}
 \caption{Phase control word}
\centering\footnotesize
\renewcommand{\tabcolsep}{4pt}
\begin{tabular}{|@{}*{18}{c|}@{}}
\hline
{} & {} & \multicolumn{16}{c}{Phase Control Word(Binary)}\\ 
\hline
frequency & Phase  & Bit & Bit & Bit & Bit & Bit & Bit & Bit & Bit & Bit &      Bit & Bit & Bit 4 & Bit 3 & Bit 2 & Bit 1 & Bit 0\\
{} & Control Word & 15 & 14 & 13 & 12 & 11 & 10 & 9 & 8 & 7 & 6 & 5 & 4 & 3  & 2 & 1 & 0\\
\hline
48000 & 16384 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\

1000 & 341 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 1 & 0 & 1 & 0 & 1 & 0 & 1\\

8000 & 2731 & 0 & 0 & 0 & 0 & 1 & 0 & 1 & 0 & 1 & 0 & 1 & 0 & 1 & 0 & 1 & 1\\

14000 & 4779 & 0 & 0 & 0 & 1 & 0 & 0 & 1 & 0 & 1 & 0 & 1 & 1 & 1 & 1 & 1 & 1\\

21000 & 7168 & 0 & 0 & 0 & 1 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\

\hline
\multicolumn{18}{l}{%
  \begin{minipage}{6.5cm}%
 Note: [By University Requirement, no text should be allowed here in this landscape table/picture page. DON''T USE sidewaystable from rotating package, it cannot align landscape title to the left binding side.].%
  \end{minipage}%
}\\

\end{tabular}
\end{table}

This is how my output looks like- enter image description here

I am missing the right margin in the right most column header and the 2nd line of table note is not center aligned. Please help me with this

  • 2
    The standard way to do this is to use the threeparttable package. See Add notes under the table (which is probably a duplicate.) – Alan Munn Sep 7 '15 at 17:31
  • 2
    To have the missing rule: \multicolumn{16}{c|}{Phase Control Word(Binary)}. To have the note below, follow Alan Munn's link and use there \begin{tablenotes} \small \item\relax\centering [By University Requirement, no text should be allowed here in this landscape table/picture page. DON''T USE sidewaystable from rotating package, it cannot align landscape title to the left binding side.]. \end{tablenotes} – Gonzalo Medina Sep 7 '15 at 17:43
  • 1
    Also, inside floats \label must go after \caption. – Gonzalo Medina Sep 7 '15 at 17:44
1
% arara: pdflatex

\documentclass{article}
\usepackage{threeparttable}
\usepackage{array} % fixes the corners
\usepackage{caption}
\usepackage{microtype}
\usepackage{chngcntr}
\counterwithin{table}{section}

\begin{document}
\setcounter{section}{3}
\setcounter{table}{5}
\begin{table}[htbp] % only use those if needed.
    \caption{Phase control word}\label{table:3.6} % label after caption!
    \centering\footnotesize
    \renewcommand{\tabcolsep}{2.1pt}
    \begin{threeparttable}
    \begin{tabular}{|*{18}{c|}@{}}
        \hline
         &  & \multicolumn{16}{c|}{Phase Control Word(Binary)}\\ 
        \hline
        Frequ. & Phase  & Bit & Bit & Bit & Bit & Bit & Bit & Bit & Bit & Bit & Bit & Bit & Bit & Bit & Bit & Bit & Bit\\
         & Control Word & 15 & 14 & 13 & 12 & 11 & 10 & 9 & 8 & 7 & 6 & 5 & 4 & 3  & 2 & 1 & 0\\        \hline
        48000 & 16384 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\         
        1000 & 341 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 1 & 0 & 1 & 0 & 1 & 0 & 1\\        
        8000 & 2731 & 0 & 0 & 0 & 0 & 1 & 0 & 1 & 0 & 1 & 0 & 1 & 0 & 1 & 0 & 1 & 1\\       
        14000 & 4779 & 0 & 0 & 0 & 1 & 0 & 0 & 1 & 0 & 1 & 0 & 1 & 1 & 1 & 1 & 1 & 1\\      
        21000 & 7168 & 0 & 0 & 0 & 1 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\      
        \hline
\end{tabular}
\begin{tablenotes}[para,flushleft]
     \centering [By University Requirement, no text should be allowed here in this landscape table/picture page. DON'T USE sidewaystable from rotating package, it cannot align landscape title to the left binding side.]. 
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}

enter image description here


You can save some more space by deleting those vertical lines:

% arara: pdflatex

\documentclass{article}
\usepackage{threeparttable}
\usepackage{array} % fixes the corners
\usepackage{caption}
\usepackage{microtype}
\usepackage{chngcntr}
\counterwithin{table}{section}
\usepackage{siunitx}
\usepackage{booktabs}
\usepackage{multirow}

\begin{document}
\setcounter{section}{3}
\setcounter{table}{5}
\begin{table}[htbp] % only use those if needed.
    \caption[Phase control word]{Phase Control Word(Binary)}\label{table:3.6} % label after caption!
    \centering\footnotesize
    \renewcommand{\tabcolsep}{2.39pt}
    \begin{threeparttable}
    \begin{tabular}{S[table-format=5.0,group-four-digits]*{17}{c}@{}}
        \toprule
        \multirow{2}{*}{Frequ.} & Phase  & Bit & Bit & Bit & Bit & Bit & Bit & Bit & Bit & Bit & Bit & Bit & Bit & Bit & Bit & Bit & Bit\\
         & Control Word & 15 & 14 & 13 & 12 & 11 & 10 & 9 & 8 & 7 & 6 & 5 & 4 & 3  & 2 & 1 & 0\\        \midrule
        48000 & 16384 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\         
        1000 & 341 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 1 & 0 & 1 & 0 & 1 & 0 & 1\\        
        8000 & 2731 & 0 & 0 & 0 & 0 & 1 & 0 & 1 & 0 & 1 & 0 & 1 & 0 & 1 & 0 & 1 & 1\\       
        14000 & 4779 & 0 & 0 & 0 & 1 & 0 & 0 & 1 & 0 & 1 & 0 & 1 & 1 & 1 & 1 & 1 & 1\\      
        21000 & 7168 & 0 & 0 & 0 & 1 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\      
        \bottomrule
\end{tabular}
\begin{tablenotes}[para,flushleft]
     \centering [By University Requirement, no text should be allowed here in this landscape table/picture page. DON'T USE sidewaystable from rotating package, it cannot align landscape title to the left binding side.]. 
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}

enter image description here

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.