Graphics, Figures & TablesSkip Columns in Tables

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
xadder
Posts: 2
Joined: Fri Dec 16, 2011 5:18 am

Skip Columns in Tables

Post by xadder »

Hi,

I have a table which is say ten columns wide. I would like to select most of the columns, but not all, for example I would like to omit the 2nd and 8th columns.

I have tried e.g. p{0mm} in the tabular line, but that didn't work.

Can I do this? It would be very useful. Thanks


(also posted on Ubuntu Forums, but no answer so far and I need an answer today, otherwise I have to start lots of hand-editing.)
Last edited by xadder on Fri Dec 16, 2011 3:13 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
User avatar
Stefan Kottwitz
Site Admin
Posts: 10308
Joined: Mon Mar 10, 2008 9:44 pm

Skip Columns in Tables

Post by Stefan Kottwitz »

Hi Xadder,

welcome to the board!

You could define a column type for hiding the cell content. For example:

Code: Select all

Code, edit and compile here:
\documentclass{article}
\usepackage{array}
\newcolumntype{H}{@{}>{\lrbox0}l<{\endlrbox}}
\begin{document}
\begin{tabular}{lHl}
text & hidden & text \\
more text & also hidden & more text
\end{tabular}
\end{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Here, the second column of H type is hidden, the @{} removes the column space between this column and the column before, it could also be placed after it.

Stefan
LaTeX.org admin
xadder
Posts: 2
Joined: Fri Dec 16, 2011 5:18 am

Re: Skip Columns in Tables

Post by xadder »

Perfect! Many thanks. I'll try to link your reply to the Ubuntu forums also.
josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

Re: Skip Columns in Tables

Post by josephwright »

Joseph Wright
Post Reply