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'm new to LaTex. I'm trying to find some sample code that shows how to create a single column table with borders (and if possible a grey header row) in a two column paper.

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

Since you mentioned IEEE, in these documentclass(es) the starred versions of table and figure span the whole page.

To have a highlighted (colored) line, just add rowcolor{your_favorite_color} before the line in question. To make this available, you need to load the colortbl and the (xcolor or color) packages in the preamble.

In my example the lipsum package is just necessary to generate some random text.

Here's a MWE you can try (I kept the title and author info from the downloadable template):

\documentclass[conference]{IEEEtran}

\usepackage{xcolor}% you could also use the color package
\usepackage{colortbl}
\usepackage{lipsum}

\begin{document}

\title{Bare Demo of IEEEtran.cls for Conferences}

\author{\authorblockN{Michael Shell}
\authorblockA{School of Electrical and\\Computer Engineering\    Georgia Institute of Technology\    Atlanta, Georgia 30332--0250\    Email: mshell@ece.gatech.edu}
\and
\authorblockN{Homer Simpson}
\authorblockA{Twentieth Century Fox\    Springfield, USA\    Email: homer@thesimpsons.com}
\and
\authorblockN{James Kirk\\ and Montgomery Scott}
\authorblockA{Starfleet Academy\    San Francisco, California 96678-2391\    Telephone: (800) 555--1212\    Fax: (888) 555--1212}}

\maketitle

\begin{abstract}
The abstract goes here.
\end{abstract}

\section{Table Example}

\lipsum[1]

\begin{table*}
\centering
\begin{tabular}{|c|c|c|}
\hline
\rowcolor{gray}
A & B & C\    \hline
1 & 2 & 3\    \hline
\end{tabular}
\end{table*}

\lipsum[2-15]

\end{document}
share|improve this answer
    
MWE... done! :) –  Count Zero Mar 4 '13 at 14:28
add comment

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.