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. Commented Dec 9, 2013 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. Commented Dec 9, 2013 at 6:20

1 Answer 1

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

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.