My question closely relates to this: Making table width fit into text width.
The answer's code is:
\maketitle
\begin{table}[hbtp]
\footnotesize
\centering
\begin{tabulary}{1.0\textwidth}{C||L|L|L|L}
\hline
& Function & Pre conditions & Post conditions & Constraints \\
\hline\hline
R1 & An election official is assigned for each precinct & Precincts and
elections officials are created & Unique one on one mapping from an
election official to precinct & Before voting starts\\ \hline
\end{tabulary}
\caption{Requirements before voting starts}
\label{eoRequirements}
\end{table}
What I would like to do is specify the width of one of the columns using, for example:
\maketitle
\begin{table}[hbtp]
\footnotesize
\centering
\begin{tabulary}{1.0\textwidth}{C||L|L|L|p{10em}}
\hline
& Function & Pre conditions & Post conditions & Constraints \\
\hline\hline
R1 & An election official is assigned for each precinct & Precincts and
elections officials are created & Unique one on one mapping from an
election official to precinct & Before voting starts\\ \hline
\end{tabulary}
\caption{Requirements before voting starts}
\label{eoRequirements}
\end{table}
This seems to make the total table width larger than \textwidth. How can I get the table width to remain at \textwidth while also specifying 1 or more column widths with p{.}? Thanks so much for any replies.
Best Answer
a
p
column is more or less just a column with a\parbox
and fortunately\parbox
works as expected. (The behaviour of thep
columns seems slightly unexpected)To use
p
columns I think the required fix is as below: