1

I have 8 columns in my table and everything fits perfectly except the very last value, which is about 5 columns long/wide (it's a very long binary string) and it's on the last row all by itself, I want it to be aligned like all the other values in the first column and just trail off, but tabular is pushing the second column all the way to the end of this one long string. It's understandable, it's just doing what it's programmed to do, but can I tell tabular to ignore how long this last value is so it can pass freely through all the columns without disrupting them?

\documentclass[10pt]{article}
\usepackage{verbatim}

\begin{document}

\begin{table}[]
\begin{tabular}{l|llllllll}
\hline %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\emph{utf-8}     & \verb s        & \verb          & \verb |        & \verb =        & \verb ~        & \verb w        & \verb          & \verb Ù        \\
\hline %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\emph{hexadec}   & \verb 73       & \verb 89       & \verb 7C       & \verb 3D       & \verb 7E       & \verb 77       & \verb 87       & \verb D9       \\
\emph{decimal}   & \verb 115      & \verb 137      & \verb 124      & \verb 061      & \verb 126      & \verb 119      & \verb 135      & \verb 217      \\
\emph{binary}    & \verb 01110011 & \verb 10001001 & \verb 01111100 & \verb 00111101 & \verb 01111110 & \verb 01110111 & \verb 10000111 & \verb 11011001 \\
                 & \verb 0111001110001001011111000011110101111110011101111000011111011001 &                                                              \\
\end{tabular}
\end{table}
\end{document}

enter image description here

10
  • So you want to have it in multiple columns?
    – user156344
    Commented May 20, 2019 at 16:51
  • @JouleV I want the columns to behave almost as if this super long value wasn't even there. See how all the rows have a huge gap there now before the second column starts, because the first column is stretched?
    – voices
    Commented May 20, 2019 at 16:58
  • So you want to set the maximum width of each column? Or make the widths fixed?
    – user156344
    Commented May 20, 2019 at 16:58
  • Use \multicolumn{7}{l}{\ttfamily 011100111000100101111100001111010111....} Commented May 20, 2019 at 17:00
  • 1
    you can merge cells, see the multicolumn use in the comment above. (I think in 30 something years of tex use that's the first time I have seen \verb delimited by spaces;-) Commented May 20, 2019 at 17:23

1 Answer 1

3

You seem to be looking for \multicolumn but also should not be using \verb here.

enter image description here

\documentclass[10pt]{article}
%\usepackage{verbatim}
\usepackage{array}
\begin{document}

\begin{table}% latex warns about an empty argument []
% use \ttfamily not space-delimited \verb
\hspace*{-61pt}\begin{tabular}{@{}l|*{8}{>{\ttfamily}l}@{}}
\hline
\emph{utf-8}     & s        &          & |        & =        & \verb|~|        & w        &          & Ù        \\
\hline 
\emph{hexadec}   & 73       & 89       & 7C       & 3D       & 7E       & 77       & 87       & D9       \\
\emph{decimal}   & 115      & 137      & 124      & 061      & 126      & 119      & 135      & 217      \\
\emph{binary}    & 01110011 & 10001001 & 01111100 & 00111101 & 01111110 & 01110111 & 10000111 & 11011001 \\
                 & \multicolumn{8}{l}{0111001110001001011111000011110101111110011101111000011111011001}  \\
\end{tabular}\hspace*{-61pt}
\end{table}
\end{document}

You must log in to answer this question.

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