[Tex/LaTex] How to remove (2) border lines from this table

tables

Any clues on how to easily remove those lines? I read other articles explaining the use of 'cline' command, but couldn't get it working myself.

\begin{table}
\scalebox{0.85}{
\setlength{\tabcolsep}{10pt}
\begin{tabular}{|p{0.35cm}|p{0.35cm}|p{0.35cm}|p{0.35cm}|p{0.35cm}|p{0.35cm}|p{0.35cm}|p{0.35cm}|p{0.35cm}|p{0.35cm}|p{0.35cm}|p{0.35cm}|p{0.35cm}|p{0.35cm}|p{0.35cm}|p{0.35cm}|p{0.35cm}|}
    \hline
    bit & 15 & 14 & 13 & 12 & 11 & 10 & 9 & 8 & 7 & 6 & 5 & 4 & 3 & 2 & 1 & 0 \\ \hline
    ~   & ~  & ~  & ~  & ~  & ~  & ~  & ~ & ~ & ~ & ~ & ~ & ~ & ~ & ~ & ~ & ~ \\
    \hline
\end{tabular}
}
\end{table}

Best Answer

Omitting the left | can be obtained by using a \multicolumn{1}{c|}{}, removing just the left | specifier.

The lower \hline has to be replaced by a column specific cline command, which has the argument {startcolumn-endcolum}, i.e.

\cline{2-17} since there are 17 columns, but only the last 16 should be underlined, omitting the first one, so start at column 2.

All columns contain the same width and specifier, so it's quicker to say

\begin{tabular}{|*{17}{p{0.35cm}|}} 

Mico made a useful comment: The ~ aren't needed at all!


\documentclass{article}

\usepackage{graphicx}%
\begin{document}


\begin{table}
\scalebox{0.85}{
\setlength{\tabcolsep}{10pt}
\begin{tabular}{|*{17}{p{0.35cm}|}}
    \hline
    bit & 15 & 14 & 13 & 12 & 11 & 10 & 9 & 8 & 7 & 6 & 5 & 4 & 3 & 2 & 1 & 0 \\ \hline
    \multicolumn{1}{c|}{~}   & ~  & ~  & ~  & ~  & ~  & ~  & ~ & ~ & ~ & ~ & ~ & ~ & ~ & ~ & ~ & ~ \\
    \cline{2-17}%
\end{tabular}
}
\end{table}
\end{document}

enter image description here

Some automated solution:

\documentclass{article}

\usepackage{graphicx}%
\usepackage{forloop}

\newcounter{othercounter}
\newcounter{loopcounter}%

\begin{document}


\begin{table}
\scalebox{0.85}{%
\setlength{\tabcolsep}{10pt}
\begin{tabular}{|*{17}{p{0.35cm}|}}
    \hline
    bit & 15 & 14 & 13 & 12 & 11 & 10 & 9 & 8 & 7 & 6 & 5 & 4 & 3 & 2 & 1 & 0 \\ \hline
    \multicolumn{1}{c|}{~}   & ~  & ~  & ~  & ~  & ~  & ~  & ~ & ~ & ~ & ~ & ~ & ~ & ~ & ~ & ~ & ~ \\
    \cline{2-17}%
\end{tabular}
}
\end{table}


\newcommand{\mybitbox}[2]{%
\begin{table}
\scalebox{#1}{
\setlength{\tabcolsep}{10pt}
\begin{tabular}{|*{#2}{p{0.35cm}|}}
    \hline
    bit \forloop[-1]{loopcounter}{\numexpr#2-2}{\number\value{loopcounter} > -1}{& \number\value{loopcounter} } \tabularnewline%
    \hline
    \multicolumn{1}{c|}{} \forloop[-1]{loopcounter}{\numexpr#2-2}{\number\value{loopcounter} > -1}{& } \tabularnewline
    \cline{2-\numexpr#2}%
\end{tabular}
}
\end{table}
}%


\forloop{othercounter}{10}{\number\value{othercounter} < 17}{%
  \mybitbox{0.85}{\number\value{othercounter}}%
}

\end{document}

enter image description here