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 building a LaTeX table for a report. I defined a fix width to the second (and last) column, so that it doesn't exceed the size of the page. For some reason, the text is overflowing the size of the cell. Here is my code:

\begin{table}[ht]
\centering
\begin{tabular}{| l | p{12cm} |}
\hline
\textbf{Código} & \textbf{CU03} \\ \hline \hline
\textbf{Nome} & Pesquisa \\ \hline
\textbf{Custo} & 3 \\ \hline
\textbf{Prioridade} & Alta \\ \hline
\textbf{Descrição} & O utilizador faz uma pesquisa simples por um paciente \\ \hline
\textbf{Pré-Condições} & O utilizador está autenticado na aplicação \\ \hline
\textbf{Pós-Condições} & São apresentados os resultados para a pesquisa feita \\ \hline
\textbf{Fluxo de acções} & 
    \begin{tabular} {l  l}
        1.  É pressionado o menu “Documentos” \\
        2.  É preenchido um ou vários dos campos disponíveis (campo1, campo2, campo3 ou       campo3) \\
        3.  É pressionado o botão “Procurar” \\
        4.  São apresentados os resultados \\
    \end{tabular} 
\\ \hline
\textbf{Dependências} & ~\ref{tab: CU01} (CU01)\\ \hline
\textbf{Mokup} & Mokup03 \\ \hline
\textbf{Testes} & TODO \\ \hline
\end{tabular}
\caption{CU03}
\label{tab: CU03}
\end{table}

and my output is this: table with overflowing cell

One last thing, I am using scribtex to compile my code.

share|improve this question

migrated from stackoverflow.com May 29 '12 at 13:05

This question came from our site for professional and enthusiast programmers.

3  
You should use an enumerate environment instead of the inner tabular. –  egreg May 29 '12 at 13:07
    
Thank you @egreg. That was the problem –  Nunoestrada May 29 '12 at 16:16

1 Answer 1

up vote 1 down vote accepted

If you don't want to use an enumerate environment, as @egreg suggests, you should replace the inner tabular, viz.,

  \begin{tabular} {l  l}

with something such as

\begin{tabular} {p{0.75cm} p{11cm}}

and insert & between the items' numbers and contents.

share|improve this answer
    
As I said in the other comment, changing to enumerate solved my problem! Thank you –  Nunoestrada May 29 '12 at 16:17

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.