3

I'm trying to create entry similar to tables using array

begin{array}{*{20}{r}}
   {}| & A |& B  \\
\hline
   A_1| & {one|} & {two}  \\
   B_2| & {three|} & {four}  \\
\hline
 \end{array}

Is there any way to draw continuous vertical lines? (something like hline for drawing horizontal lines?)

2
  • Put | into column argument, say begin{array}{|*{20}{r|}}, and you will get what you want.
    – Ch'en Meng
    Dec 9 '13 at 6:13
  • @Ch'enMeng ; Thank you for solution and correcting typos; my English is not good, i'll try my best to avoid typos.
    – Pawan Mude
    Dec 9 '13 at 6:20
5

Certainly:

\documentclass{article}

\begin{document}

\[
%\begin{array}{*{20}{r}}
\begin{array}{|*{3}{r|}} % because later only 3 columns
%   {}| & A |& B  \\
{} & A & B  \\
\hline
%   A_1| & {one|} & {two}  \\
 A_1& {one} & {two}  \\
%   B_2| & {three|} & {four}  \\
 B_2 & {three} & {four}  \\
\hline
 \end{array}
\]

\end{document}

enter image description here

Every vertical line in the description of columns (r|'s here) produces a vertical line through the whole array. I understand that your one to four words are only artificial ones.

0

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.