Graphics, Figures & TablesNeed help tweaking supertabular table

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
pjmiller_57
Posts: 20
Joined: Tue Nov 08, 2011 4:37 pm

Need help tweaking supertabular table

Post by pjmiller_57 »

Hello All,

Am still learning LaTeX. I've managed to write code for what will be a multipage table. My code appears below.

Now I need some help tweaking what I've done.

Need to do a few things:
  1. Eliminate the horizontal lines around the cell containing "HEC/MEC Group". Reduce the size of the horizontal line below "HEC/MEC Group" so that it spans only the columns labeled "Current", "Last 6 Months", and "Naive".
  2. Indent the lines labeled "Caucasian" and "Black or African American" in the first column, but not the line labled "Race, n(%)".
  3. Decimal align the columns. If possible, I'd like the entries to look like:

    164 (80.0%)
    _33 (16.1%)

    where the "_" represents a space.
Thanks,

Paul

Code: Select all

\documentclass{article}

%%%% Margins %%%%
\setlength{\textwidth}{6.25in}
\setlength{\oddsidemargin}{0in}

%%%% Packages %%%%
\usepackage{parskip}
\usepackage{here}
\usepackage[font={bf},justification=centerfirst]{caption}
\DeclareCaptionLabelSeparator{period-newline}{. }
\captionsetup{singlelinecheck=false,labelsep=period-newline,aboveskip=6pt}
\usepackage{supertabular}
\usepackage[newcommands]{ragged2e}
% \usepackage{dcolumn}
% \newcolumntype{d}[1]{D{.}{\cdot}{#1}}
% \newcolumntype{.}{D{.}{.}{-1}}
% \newcolumntype{,}{D{,}{,}{2}}
\usepackage[
pdftex,
pdfstartpage=1,
pdfpagemode=UseOutlines,
bookmarks,
bookmarksopen,
pdfstartview=Fit,
pdfview=Fit]
{hyperref}

%%%% Title %%%%
\title{Tables for CINV Conjoint Paper}
\author{Paul J. Miller, Ph.D.}

\begin{document}

\maketitle

\vspace{0.125in}

\tablecaption{Demographic Characteristics \vspace{-6pt}}
\tablehead{\hline  & \multicolumn{3}{|c|}{\bfseries HEC/MEC Group} & \\ \hline 
            & \bfseries Current & \bfseries Last 6 Months & \bfseries Naive & \bfseries Total \\ 
            & \bfseries (N = 205) & \bfseries (N = 66)  & \bfseries (N = 30) & \bfseries (N = 301) \\ \hline}
\tabletail{\hline \multicolumn{3}{r}{\emph{Continued on next page}}\\}
\tablelasttail{\hline}
\begin{supertabular}{lcccc}
%\begin{supertabular}{d{-1}|d{2}|.|.|.|}
%\begin{supertabular}{|D..{2}||D..{2}||D..{2}||D..{2}||D..{2}|}
Race, n (\%) \\
Caucasian                 & 164 (80.0\%) & 51 (77.3\%) & 23 (76.7\%) & 238 (79.1\%) \\ 
Black or African American &  33 (16.1\%) & 10 (15.2\%) &  6 (20.0\%) &  49 (16.3\%) \\  
\end{supertabular} 

\end{document}
Last edited by cgnieder on Thu Aug 30, 2012 5:51 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

Post Reply