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:
- 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".
- Indent the lines labeled "Caucasian" and "Black or African American" in the first column, but not the line labled "Race, n(%)".
- 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.
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}