Take the 2-minute tour ×

Possible Duplicate:
Create a vertical line in a table that spans a range of rows but not all rows


I would like to have a similar command vertical line across the rows, so that it is possible, for example, to draw a "ladder".

share|improve this question

marked as duplicate by lockstep, egreg, Gonzalo Medina, Joseph Wright Sep 21 '11 at 7:17


2 Answers 2

You have to create a \multicolumn{1}{c|}{...} for that column cells.

share|improve this answer

It wasn't quite clear what knowledge level you have at the moment. In general a vertical line is produced by inserting a "pipe" character, which is on the "\" key or Alt + 0124. The | is placed on one side or other of a column specifier such as "c". If all you want to do is create a ladder with no missing pieces then you might want:

   \hline \\[1cm]
   \hline \\[1cm]
   \hline \\[1cm]
   \hline \\[1cm]
   \hline \\[1cm]

where the \\[1cm] tells it to leave a 1cm gap after row.

If you want to have missing parts of the ladder, then you need Herbert's suggestion. Replacing a given row with \multicolumn{1}{c}{} will tell it to affect 1 column (first argument) and replace the |c| with just c (second argument) and hence remove the lines either side of the ladder. The final argument is what ever you want to appear in the cell, if anything.

To make it easy for you, if you replace one of the lines of the code for the ladder with: \hline \multicolumn{1}{c|}{} \\[1cm] which was in basically what Herbert was suggesting, then between two rungs of the ladder, the left most vertical will be missed out.

If you want to make you ladder wider, while keeping it blank, then you can insert \hspace{3cm} between the \hline and the \\[1cm] on a line of your choice.

Hope that helps

share|improve this answer
