3

When you put two \hline in a latex table it separates it in two different blocks. I want to make that, but in the vertical direction I have tried putting in the tabular options{|c||cccc|} but this doesn't work beause horizontal lines cross the entire table without leaving a blanck between the first and second column.

My table is as follows.

\begin{table}[]
    \centering
    \begin{tabular}{|c||ccccccccc|}
    \hline
         r,s & 0&1& 2&3&4&5&6&7&8 \\ \hline \hline
         0& 1&$\R\oplus \R$ & $\R(2)$ & $\C(2)$&$\H(2)$&$\H(2)\oplus\H(2)$&$\H(4)$&$\H(4)\oplus\H(4)$&$\R(16)$\\
         \hline
    \end{tabular}
    \caption{Caption}
    \label{tab:my_label}
\end{table}
5
  • use || and then use \hhline from the package of that name if you don't want the hlines to cross. Feb 8, 2017 at 22:40
  • Welcome to TeX SX! What are \R, \C, \H?
    – Bernard
    Feb 8, 2017 at 22:43
  • @Bernard, I'm almost sure that it means \mathbb{R} and so on... very popular new commands for math papers.... lol
    – Sigur
    Feb 8, 2017 at 22:54
  • \H is a very bad idea for that purpose because it is already defined, this could make bibliographies entertaining
    – Au101
    Feb 8, 2017 at 22:59
  • 1
    @Au101 -- for some definition of "entertaining". (in a production environment, "exasperating" is more often closer to the epithet used, while striving to remain polite.) Feb 9, 2017 at 2:17

2 Answers 2

3

enter image description here

\documentclass{article}

\usepackage{hhline}


\begin{document}

\begin{table}
    \centering
    \begin{tabular}{|c||ccccccccc|}
    \hhline{-||---------}
         r,s & 0&1& 2&3&4&5&6&7&8 \\ \hhline{=::=========}
         0& 1&$R\oplus R$ & $R(2)$ & $C(2)$&$H(2)$&
$H(2)\oplus
H(2)$&$H(4)$&$H(4)\oplus H(4)$&$R(16)$\\
           \hhline{-||---------}
    \end{tabular}
    \caption{Caption}
    \label{tab:my_label}
\end{table}
\end{document}
0

With {NiceArray} of nicematrix.

\documentclass{article}
\usepackage{caption}
\usepackage{nicematrix,tikz}

\begin{document}

\begin{table}
\centering
\renewcommand{\arraystretch}{1.3}
\NiceMatrixOptions{exterior-arraycolsep}

$\begin{NiceArray}{cccccccccc}
r,s & \Block{1-*}{} 0 & 1          & 2    & 3    & 4    & 5                & 6    & 7               & 8     \\ 
0   & \Block{1-*}{} 1 & R \oplus R & R(2) & C(2) & H(2) & H(2) \oplus H(2) & H(4) & H(4)\oplus H(4) & R(16) \\
\CodeAfter \TikzEveryCell{offset=1pt,draw}
\end{NiceArray}$

\caption{Caption}
\label{tab:my_label}
\end{table}

\end{document}

Output of the above code

You must log in to answer this question.

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