# Creating Table using array

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?)

• Put | into column argument, say begin{array}{|*{20}{r|}}, and you will get what you want. 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. Dec 9 '13 at 6:20

\documentclass{article}
$%\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}$

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.