Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am having trouble doing the following in the tabular environment:

title1   title2
------   ------
a        1
b        2
.        .
.        .
.        .
z        26

That, having only the column titles underlined and instead of the usual line across all columns. I want the space in between columns without having a vertical line in between columns.

share|improve this question
    
Either set two separate tabulars, or one with an empty (second) column and use \cline{1-1}\cline{3-3} (say). –  Werner Jan 27 '12 at 20:13
    
thanks, I used your second suggestion and it worked. –  Gary Gramajo Jan 27 '12 at 20:19

1 Answer 1

I suggest you give the booktabs package a try. The following MWE (Minimum Working Example) shows how one might use its commands \toprule, \bottomrule, and \cmidrule. These commands work pretty much like the LaTeX commands \hline and \cline, except that they provide much better spacing above and below the horizontal lines. In addition, the lines created by \toprule and \bottomrule are heavier (thicker) than those created by \midrule and \cmidrule, further contributing to a polished appearance of the table.

\documentclass{article}
\usepackage{booktabs}
\begin{document}
\begin{tabular}{cc}
\toprule
title1 & title2 \\
\cmidrule(r){1-1} \cmidrule(l){2-2}
a & 1\\
$\vdots$ & $\vdots$\\
z & 26 \\
\bottomrule
\end{tabular}
\end{document}

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.