5

enter image description here

The lines of my table are not connected.
I need a table where every lines should be connected.

The LaTeX code for the table is as follows:

\begin{table}[]
\centering
\resizebox{\textwidth}{!}{%
\begin{tabular}{|c|ccccccccccccc|}
\hline
\multirow{2}{*}{Constant Value of the real part} & \multicolumn{13}{c|}{Binary representation of real part} \\ \cline{2-14} 
 & \multicolumn{1}{c|}{20} & \multicolumn{2}{c|}{2-1} & \multicolumn{1}{c|}{2-2} & \multicolumn{1}{c|}{2-3} & \multicolumn{1}{c|}{2-4} & \multicolumn{1}{c|}{2-5} & \multicolumn{1}{c|}{2-6} & \multicolumn{1}{c|}{2-7} & \multicolumn{1}{c|}{2-8} & \multicolumn{1}{c|}{2-9} & \multicolumn{1}{c|}{2-10} & 2-11 \\ \hline
0.9988 & \multicolumn{2}{c|}{1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{-1} & \multicolumn{1}{c|}{0} & 1 \\ \hline
0.9952 & \multicolumn{2}{c|}{1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{-1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{-1} & 0 \\ \hline
0.9892 & \multicolumn{2}{c|}{1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{-1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & 1 \\ \hline
0.9808 & \multicolumn{2}{c|}{1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{-1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{-1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & 0 \\ \hline
0.9697 & \multicolumn{2}{c|}{1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{-1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{1} & 0 \\ \hline
0.9569 & \multicolumn{2}{c|}{1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{-1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & -1 \\ \hline
0.9415 & \multicolumn{2}{c|}{1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{-1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & 0 \\ \hline
0.9239 & \multicolumn{2}{c|}{1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{-1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{-1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{1} & \multicolumn{1}{c|}{0} & 0 \\ \hline
0.9040 & \multicolumn{2}{c|}{1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{-1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{-1} & \multicolumn{1}{c|}{0} & -1 \\ \hline
0.8819 & \multicolumn{2}{c|}{1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{-1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{-1} & 0 \\ \hline
0.8577 & \multicolumn{2}{c|}{1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{-1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{-1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{-1} & \multicolumn{1}{c|}{0} & 0 \\ \hline
0.8315 & \multicolumn{2}{c|}{1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{-1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{-1} & 0 \\ \hline
0.8032 & \multicolumn{2}{c|}{1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{-1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{-1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{-1} & \multicolumn{1}{c|}{0} & 0 \\ \hline
0.7730 & \multicolumn{2}{c|}{1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{-1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{-1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & 1 \\ \hline
0.7410 & \multicolumn{2}{c|}{1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{-1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{-1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{-1} & \multicolumn{1}{c|}{0} & 1 \\ \hline
0.7071 & \multicolumn{2}{c|}{1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{-1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{1} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{0} & 0 \\ \hline
\end{tabular}%
}
\end{table}
1
  • 3
    Welcome to TeX.SX! The problem is that you use \multicolumn{2}{}{} in several rows differently: In the second row in column 3 but in all following rows in column 2. But do you really need all these \multicolumn commands? I'd also suggest not to use \resizebox to scale the tabular. Please extend your code snippet to a full minimal working example (MWE). Commented Jan 12 at 6:10

4 Answers 4

13

The problem is that in your code you use \multicolumn{2}{}{} in the second column, but in the second row you use it in the third column. This, of course, does not line up.

I assume that the code you present was generated by some table generator which more often than not create code that is hard to read and difficult to maintain. I'd therefore suggest that you clean up the code and remove all these unnessecary \multicolumn commands. Things can be much easier then and there is no need to scale the tabular using \resizebox which is bad practice as it distorts font sizes:

\documentclass{article}
\usepackage[margin=2cm]{geometry}
\usepackage{multirow}

\begin{document}
    
\begin{tabular}{ | *{13}{c|} }
\hline
\multirow{2}{2.5cm}{\centering Constant Value of the real part} & 
    \multicolumn{12}{c|}{Binary representation of real part} \\ \cline{2-13} 
 & 20 & 2-1 & 2-2 & 2-3 & 2-4 & 2-5 & 2-6 & 2-7 & 2-8 & 2-9 & 2-10 & 2-11 \\ \hline
0.9988 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & -1 & 0 & 1 \\ \hline
0.9952 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & -1 & 0 & -1 & 0 \\ \hline
0.9892 & 1 & 0 & 0 & 0 & 0 & 0 & -1 & 0 & 1 & 0 & 0 & 1 \\ \hline
0.9808 & 1 & 0 & 0 & 0 & 0 & 0 & -1 & 0 & -1 & 0 & 0 & 0 \\ \hline
0.9697 & 1 & 0 & 0 & 0 & 0 & -1 & 0 & 0 & 0 & 0 & 1 & 0 \\ \hline
0.9569 & 1 & 0 & 0 & 0 & -1 & 0 & 1 & 0 & 1 & 0 & 0 & -1 \\ \hline
0.9415 & 1 & 0 & 0 & 0 & -1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ \hline
0.9239 & 1 & 0 & 0 & 0 & -1 & 0 & -1 & 0 & 0 & 1 & 0 & 0 \\ \hline
0.9040 & 1 & 0 & 0 & -1 & 0 & 1 & 0 & 0 & 0 & -1 & 0 & -1 \\ \hline
0.8819 & 1 & 0 & 0 & -1 & 0 & 0 & 0 & 1 & 0 & 0 & -1 & 0 \\ \hline
0.8577 & 1 & 0 & 0 & -1 & 0 & 0 & -1 & 0 & 0 & -1 & 0 & 0 \\ \hline
0.8315 & 1 & 0 & -1 & 0 & 0 & 0 & 1 & 0 & 1 & 0 & -1 & 0 \\ \hline
0.8032 & 1 & 0 & -1 & 0 & 0 & 0 & 0 & -1 & 0 & -1 & 0 & 0 \\ \hline
0.7730 & 1 & 0 & -1 & 0 & 0 & 1 & 0 & -1 & 0 & 0 & 0 & 1 \\ \hline
0.7410 & 1 & 0 & -1 & 0 & 0 & 0 & 0 & -1 & 0 & -1 & 0 & 1 \\ \hline
0.7071 & 1 & 0 & -1 & 0 & 0 & 0 & 1 & 0 & 1 & 0 & 0 & 0 \\ \hline
\end{tabular}
    
\end{document}

enter image description here

For proper typesetting of the minus signs you might want to use math mode in the relevant cells (thanks to Mico for the hint):

\documentclass{article}
\usepackage[margin=2cm]{geometry}
\usepackage{array, multirow}
\newcolumntype{C}{>{$}c<{$}}

\begin{document}

\begin{tabular}{ | *{13}{C|} }
\hline
\multirow{2}{2.5cm}{\centering Constant Value of the real part} & 
    \multicolumn{12}{c|}{Binary representation of real part} \\ \cline{2-13} 
 & \textrm{2-0} & \textrm{2-1} & \textrm{2-2} & \textrm{2-3} & \textrm{2-4} & \textrm{2-5} & \textrm{2-6} & \textrm{2-7} & \textrm{2-8} & \textrm{2-9} & \textrm{2-10} & \textrm{2-11} \\ \hline
0.9988 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & -1 & 0 & 1 \\ \hline
0.9952 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & -1 & 0 & -1 & 0 \\ \hline
0.9892 & 1 & 0 & 0 & 0 & 0 & 0 & -1 & 0 & 1 & 0 & 0 & 1 \\ \hline
0.9808 & 1 & 0 & 0 & 0 & 0 & 0 & -1 & 0 & -1 & 0 & 0 & 0 \\ \hline
0.9697 & 1 & 0 & 0 & 0 & 0 & -1 & 0 & 0 & 0 & 0 & 1 & 0 \\ \hline
0.9569 & 1 & 0 & 0 & 0 & -1 & 0 & 1 & 0 & 1 & 0 & 0 & -1 \\ \hline
0.9415 & 1 & 0 & 0 & 0 & -1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ \hline
0.9239 & 1 & 0 & 0 & 0 & -1 & 0 & -1 & 0 & 0 & 1 & 0 & 0 \\ \hline
0.9040 & 1 & 0 & 0 & -1 & 0 & 1 & 0 & 0 & 0 & -1 & 0 & -1 \\ \hline
0.8819 & 1 & 0 & 0 & -1 & 0 & 0 & 0 & 1 & 0 & 0 & -1 & 0 \\ \hline
0.8577 & 1 & 0 & 0 & -1 & 0 & 0 & -1 & 0 & 0 & -1 & 0 & 0 \\ \hline
0.8315 & 1 & 0 & -1 & 0 & 0 & 0 & 1 & 0 & 1 & 0 & -1 & 0 \\ \hline
0.8032 & 1 & 0 & -1 & 0 & 0 & 0 & 0 & -1 & 0 & -1 & 0 & 0 \\ \hline
0.7730 & 1 & 0 & -1 & 0 & 0 & 1 & 0 & -1 & 0 & 0 & 0 & 1 \\ \hline
0.7410 & 1 & 0 & -1 & 0 & 0 & 0 & 0 & -1 & 0 & -1 & 0 & 1 \\ \hline
0.7071 & 1 & 0 & -1 & 0 & 0 & 0 & 1 & 0 & 1 & 0 & 0 & 0 \\ \hline
\end{tabular}

\end{document}

enter image description here


Another approach could be to use the booktabs package and remove the vertical rules altogether:

\documentclass{article}
\usepackage[margin=2cm]{geometry}
\usepackage{array, multirow, booktabs}
\newcolumntype{C}{>{$}c<{$}}

\begin{document}

\begin{tabular}{ *{13}{C} }
\toprule
 & \multicolumn{12}{c}{Binary representation of real part} \\ \cmidrule{2-13} 
\multirow{-2}{2.5cm}{\centering Constant Value of the real part} 
 & \textrm{2-0} & \textrm{2-1} & \textrm{2-2} & \textrm{2-3} & \textrm{2-4} & \textrm{2-5} & \textrm{2-6} & \textrm{2-7} & \textrm{2-8} & \textrm{2-9} & \textrm{2-10} & \textrm{2-11} \\ 
\midrule
0.9988 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & -1 & 0 & 1 \\ 
0.9952 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & -1 & 0 & -1 & 0 \\ 
0.9892 & 1 & 0 & 0 & 0 & 0 & 0 & -1 & 0 & 1 & 0 & 0 & 1 \\ 
0.9808 & 1 & 0 & 0 & 0 & 0 & 0 & -1 & 0 & -1 & 0 & 0 & 0 \\ 
0.9697 & 1 & 0 & 0 & 0 & 0 & -1 & 0 & 0 & 0 & 0 & 1 & 0 \\ 
0.9569 & 1 & 0 & 0 & 0 & -1 & 0 & 1 & 0 & 1 & 0 & 0 & -1 \\ 
0.9415 & 1 & 0 & 0 & 0 & -1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 
0.9239 & 1 & 0 & 0 & 0 & -1 & 0 & -1 & 0 & 0 & 1 & 0 & 0 \\ 
0.9040 & 1 & 0 & 0 & -1 & 0 & 1 & 0 & 0 & 0 & -1 & 0 & -1 \\ 
0.8819 & 1 & 0 & 0 & -1 & 0 & 0 & 0 & 1 & 0 & 0 & -1 & 0 \\ 
0.8577 & 1 & 0 & 0 & -1 & 0 & 0 & -1 & 0 & 0 & -1 & 0 & 0 \\ 
0.8315 & 1 & 0 & -1 & 0 & 0 & 0 & 1 & 0 & 1 & 0 & -1 & 0 \\ 
0.8032 & 1 & 0 & -1 & 0 & 0 & 0 & 0 & -1 & 0 & -1 & 0 & 0 \\ 
0.7730 & 1 & 0 & -1 & 0 & 0 & 1 & 0 & -1 & 0 & 0 & 0 & 1 \\ 
0.7410 & 1 & 0 & -1 & 0 & 0 & 0 & 0 & -1 & 0 & -1 & 0 & 1 \\ 
0.7071 & 1 & 0 & -1 & 0 & 0 & 0 & 1 & 0 & 1 & 0 & 0 & 0 \\ 
\bottomrule
\end{tabular}

\end{document}

enter image description here

2
  • 1
    +1 (suggestion: add an alternating light grey row background on the second example).
    – Rmano
    Commented Jan 12 at 10:13
  • 1
    A minor suggestion: Use array instead of tabular for automatic math mode. That way, the - symbols will get typeset as math-minus symbols instead of as text-mode dashes.
    – Mico
    Commented Jan 12 at 11:38
8

I suggest you use a tabular* environment to assure that the table fits inside the textblock or, equivalently, that the table's width equals \textwidth. I'd also assure that the 12 data columns have equal width, and I'd align the number on their implied decimal markers. Oh, and I'd also get rid of all vertical rules and use far fewer, but well-spaced, horizontal rules.

enter image description here

\documentclass{article}
\usepackage{amsmath,booktabs,siunitx}
\newcommand\mytab[1]{\smash[b]{%
   \begin{tabular}[t]{@{}l@{}} #1 \end{tabular}}}
\newcommand\mc[1]{\multicolumn{1}{c}{#1}} % handy shortcut macro

\begin{document}

\begin{table}
\setlength\tabcolsep{0pt} % make LaTeX figure out the amount of intercolumn whitespace

\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} 
    c 
    *{12}{S[table-format=-1.0]} @{}}
\toprule
\mytab{Constant value\\of real part} & 
\multicolumn{12}{c}{Binary representation of real part} \\ 
\cmidrule{2-13} 
  & \mc{2-0} & \mc{2-1} & \mc{2-2} & \mc{2-3} 
  & \mc{2-4} & \mc{2-5} & \mc{2-6} & \mc{2-7} 
  & \mc{2-8} & \mc{2-9} & \mc{\llap{2}-10}& \mc{\llap{2}-11} \\ 
\midrule
0.9988 & 1 & 0 &  0 &  0 &  0 &  0 &  0 &  0 &  0 & -1 &  0 &  1 \\
0.9952 & 1 & 0 &  0 &  0 &  0 &  0 &  0 &  0 & -1 &  0 & -1 &  0 \\
0.9892 & 1 & 0 &  0 &  0 &  0 &  0 & -1 &  0 &  1 &  0 &  0 &  1 \\
0.9808 & 1 & 0 &  0 &  0 &  0 &  0 & -1 &  0 & -1 &  0 &  0 &  0 \\
\addlinespace
0.9697 & 1 & 0 &  0 &  0 &  0 & -1 &  0 &  0 &  0 &  0 &  1 &  0 \\
0.9569 & 1 & 0 &  0 &  0 & -1 &  0 &  1 &  0 &  1 &  0 &  0 & -1 \\
0.9415 & 1 & 0 &  0 &  0 & -1 &  0 &  0 &  0 &  1 &  0 &  0 &  0 \\
0.9239 & 1 & 0 &  0 &  0 & -1 &  0 & -1 &  0 &  0 &  1 &  0 &  0 \\
\addlinespace
0.9040 & 1 & 0 &  0 & -1 &  0 &  1 &  0 &  0 &  0 & -1 &  0 & -1 \\
0.8819 & 1 & 0 &  0 & -1 &  0 &  0 &  0 &  1 &  0 &  0 & -1 &  0 \\
0.8577 & 1 & 0 &  0 & -1 &  0 &  0 & -1 &  0 &  0 & -1 &  0 &  0 \\
0.8315 & 1 & 0 & -1 &  0 &  0 &  0 &  1 &  0 &  1 &  0 & -1 &  0 \\
\addlinespace
0.8032 & 1 & 0 & -1 &  0 &  0 &  0 &  0 & -1 &  0 & -1 &  0 &  0 \\
0.7730 & 1 & 0 & -1 &  0 &  0 &  1 &  0 & -1 &  0 &  0 &  0 &  1 \\
0.7410 & 1 & 0 & -1 &  0 &  0 &  0 &  0 & -1 &  0 & -1 &  0 &  1 \\
0.7071 & 1 & 0 & -1 &  0 &  0 &  0 &  1 &  0 &  1 &  0 &  0 &  0 \\ 
\bottomrule
\end{tabular*}

\end{table}

\end{document} 
6

I guess you're a victim of some software claiming to produce good code for tables. It's obviously completely wrong to have \multicolumn declarations for every entry in a column.

Moreover, the software got the number of columns wrong.

Here's a different realization using booktabs and automatic sizing of the intercolumn space. Avoid resizing.

\documentclass{article}
\usepackage{amsmath}
\usepackage{array,booktabs}

\begin{document}

\begin{table}[htp]
\centering\small

\setlength{\tabcolsep}{0pt}% let TeX compute
\begin{tabular*}{\textwidth}{
  @{\extracolsep{\fill}}
  c
  *{12}{>{$}c<{$}}
}
\toprule
\smash{\begin{tabular}[t]{@{}c@{}} Real \\ part \end{tabular}}
& \multicolumn{12}{c}{Binary representation of real part} \\
\cmidrule{2-13}
& \text{2--0}
& \text{2--1} & \text{2--2} & \text{2--3} & \text{2--4} 
& \text{2--5} & \text{2--6} & \text{2--7} & \text{2--8} 
& \text{2--9} & \text{2--10} & \text{2--11} \\
\midrule
0.9988 & 1 & 0 &  0 &  0 &  0 &  0 &  0 &  0 &  0 & -1 &  0 &  1 \\
0.9952 & 1 & 0 &  0 &  0 &  0 &  0 &  0 &  0 & -1 &  0 & -1 &  0 \\
0.9892 & 1 & 0 &  0 &  0 &  0 &  0 & -1 &  0 &  1 &  0 &  0 &  1 \\
0.9808 & 1 & 0 &  0 &  0 &  0 &  0 & -1 &  0 & -1 &  0 &  0 &  0 \\
0.9697 & 1 & 0 &  0 &  0 &  0 & -1 &  0 &  0 &  0 &  0 &  1 &  0 \\
0.9569 & 1 & 0 &  0 &  0 & -1 &  0 &  1 &  0 &  1 &  0 &  0 & -1 \\
0.9415 & 1 & 0 &  0 &  0 & -1 &  0 &  0 &  0 &  1 &  0 &  0 &  0 \\
0.9239 & 1 & 0 &  0 &  0 & -1 &  0 & -1 &  0 &  0 &  1 &  0 &  0 \\
0.9040 & 1 & 0 &  0 & -1 &  0 &  1 &  0 &  0 &  0 & -1 &  0 & -1 \\
0.8819 & 1 & 0 &  0 & -1 &  0 &  0 &  0 &  1 &  0 &  0 & -1 &  0 \\
0.8577 & 1 & 0 &  0 & -1 &  0 &  0 & -1 &  0 &  0 & -1 &  0 &  0 \\
0.8315 & 1 & 0 & -1 &  0 &  0 &  0 &  1 &  0 &  1 &  0 & -1 &  0 \\
0.8032 & 1 & 0 & -1 &  0 &  0 &  0 &  0 & -1 &  0 & -1 &  0 &  0 \\
0.7730 & 1 & 0 & -1 &  0 &  0 &  1 &  0 & -1 &  0 &  0 &  0 &  1 \\
0.7410 & 1 & 0 & -1 &  0 &  0 &  0 &  0 & -1 &  0 & -1 &  0 &  1 \\
0.7071 & 1 & 0 & -1 &  0 &  0 &  0 &  1 &  0 &  1 &  0 &  0 &  0 \\
\bottomrule
\end{tabular*}

\end{table}

\end{document}

enter image description here

I don't think that “Constant value of the real part” is clearer than just “Real part”.

If you really want a caged table

\documentclass{article}
\usepackage{amsmath}
\usepackage{array}

\begin{document}

\begin{table}[htp]
\centering\footnotesize

\addtolength{\tabcolsep}{-.066pt}

\begin{tabular}{
  |c|
  *{12}{>{$}c<{$}|}
}
\hline
\smash{\begin{tabular}[t]{@{}c@{}}Real \\ part \end{tabular}} &
\multicolumn{12}{c|}{Binary representation of real part} \\
\cline{2-13}
& \text{2--0}
& \text{2--1} & \text{2--2} & \text{2--3} & \text{2--4} 
& \text{2--5} & \text{2--6} & \text{2--7} & \text{2--8} 
& \text{2--9} & \text{2--10} & \text{2--11} \\ \hline
0.9988 & 1 & 0 &  0 &  0 &  0 &  0 &  0 &  0 &  0 & -1 &  0 &  1 \\ \hline
0.9952 & 1 & 0 &  0 &  0 &  0 &  0 &  0 &  0 & -1 &  0 & -1 &  0 \\ \hline
0.9892 & 1 & 0 &  0 &  0 &  0 &  0 & -1 &  0 &  1 &  0 &  0 &  1 \\ \hline
0.9808 & 1 & 0 &  0 &  0 &  0 &  0 & -1 &  0 & -1 &  0 &  0 &  0 \\ \hline
0.9697 & 1 & 0 &  0 &  0 &  0 & -1 &  0 &  0 &  0 &  0 &  1 &  0 \\ \hline
0.9569 & 1 & 0 &  0 &  0 & -1 &  0 &  1 &  0 &  1 &  0 &  0 & -1 \\ \hline
0.9415 & 1 & 0 &  0 &  0 & -1 &  0 &  0 &  0 &  1 &  0 &  0 &  0 \\ \hline
0.9239 & 1 & 0 &  0 &  0 & -1 &  0 & -1 &  0 &  0 &  1 &  0 &  0 \\ \hline
0.9040 & 1 & 0 &  0 & -1 &  0 &  1 &  0 &  0 &  0 & -1 &  0 & -1 \\ \hline
0.8819 & 1 & 0 &  0 & -1 &  0 &  0 &  0 &  1 &  0 &  0 & -1 &  0 \\ \hline
0.8577 & 1 & 0 &  0 & -1 &  0 &  0 & -1 &  0 &  0 & -1 &  0 &  0 \\ \hline
0.8315 & 1 & 0 & -1 &  0 &  0 &  0 &  1 &  0 &  1 &  0 & -1 &  0 \\ \hline
0.8032 & 1 & 0 & -1 &  0 &  0 &  0 &  0 & -1 &  0 & -1 &  0 &  0 \\ \hline
0.7730 & 1 & 0 & -1 &  0 &  0 &  1 &  0 & -1 &  0 &  0 &  0 &  1 \\ \hline
0.7410 & 1 & 0 & -1 &  0 &  0 &  0 &  0 & -1 &  0 & -1 &  0 &  1 \\ \hline
0.7071 & 1 & 0 & -1 &  0 &  0 &  0 &  1 &  0 &  1 &  0 &  0 &  0 \\ \hline
\end{tabular}

\end{table}

\end{document}

The small adjustment to \tabcolsep may not be necessary depending on the text width in your document. If you have less generous margins, you might as well be done with \small.

enter image description here

5

Taking a cue from the suggestion by @Rmano

enter image description here

MWE

\documentclass{article}
\usepackage[margin=2cm]{geometry}
\usepackage{nicematrix, xcolor}

\usepackage{booktabs}

\begin{document}
    \begin{NiceTabular}{ *{13}{c} }
        \CodeBefore
        \rowcolor{gray!50}{1}
        \rowcolors{2}{gray!25}{white}
        \Body
        \toprule
\Block[fill=white]{2-1}{Constant Value \\of the real part}                                                                                  &\Block{1-12}{Binary representation of real part} &&&&&&&&&&&\\ 
& 20 & 2-1 & 2-2 & 2-3 & 2-4 & 2-5 & 2-6 & 2-7 & 2-8 & 2-9 & 2-10 & 2-11 \\ 
        \midrule
        0.9988 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & -1 & 0 & 1 \\ 
        0.9952 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & -1 & 0 & -1 & 0 \\ 
        0.9892 & 1 & 0 & 0 & 0 & 0 & 0 & -1 & 0 & 1 & 0 & 0 & 1 \\ 
        0.9808 & 1 & 0 & 0 & 0 & 0 & 0 & -1 & 0 & -1 & 0 & 0 & 0 \\ 
        0.9697 & 1 & 0 & 0 & 0 & 0 & -1 & 0 & 0 & 0 & 0 & 1 & 0 \\ 
        0.9569 & 1 & 0 & 0 & 0 & -1 & 0 & 1 & 0 & 1 & 0 & 0 & -1 \\ 
        0.9415 & 1 & 0 & 0 & 0 & -1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 
        0.9239 & 1 & 0 & 0 & 0 & -1 & 0 & -1 & 0 & 0 & 1 & 0 & 0 \\ 
        0.9040 & 1 & 0 & 0 & -1 & 0 & 1 & 0 & 0 & 0 & -1 & 0 & -1 \\ 
        0.8819 & 1 & 0 & 0 & -1 & 0 & 0 & 0 & 1 & 0 & 0 & -1 & 0 \\ 
        0.8577 & 1 & 0 & 0 & -1 & 0 & 0 & -1 & 0 & 0 & -1 & 0 & 0 \\ 
        0.8315 & 1 & 0 & -1 & 0 & 0 & 0 & 1 & 0 & 1 & 0 & -1 & 0 \\ 
        0.8032 & 1 & 0 & -1 & 0 & 0 & 0 & 0 & -1 & 0 & -1 & 0 & 0 \\ 
        0.7730 & 1 & 0 & -1 & 0 & 0 & 1 & 0 & -1 & 0 & 0 & 0 & 1 \\ 
        0.7410 & 1 & 0 & -1 & 0 & 0 & 0 & 0 & -1 & 0 & -1 & 0 & 1 \\ 
        0.7071 & 1 & 0 & -1 & 0 & 0 & 0 & 1 & 0 & 1 & 0 & 0 & 0 \\ 
        \bottomrule
        
    \end{NiceTabular}
    
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .