
Gostaria de criar uma tabela tabular usando o código a seguir.
\documentclass[journal]{IEEEtran}
\usepackage{tabularx}
\usepackage{booktabs}
\renewcommand{\arraystretch}{1.25}
\noindent\begin{tabularx}{\textwidth} { |
l |
>{\raggedright\arraybackslash}X |
c |
}
\hline
Place/Transition & Explanation & Time \\
\hline
$T_1$ and $T_{2(n+1)}$ & Robot operation which relates to loadlocks. Transition $T_1$ indicates that wafer unloading from the loadlocks and $T_{2(n+1)}$ means that the robot loads the wafer to the loadlocks. & w \\
\hline
item 31 & item 32 & item 33 \\
\hline
\end{tabularx}
Aqui está o resultado.
Perguntas: (1) Como garantir que toda a tabela caiba no modelo de duas colunas? (2) Como posso adicionar mais linhas na tabela?
Obrigado.
Responder1
Sugiro que você (a) defina a largura do tabularx
ambiente como \columnwidth
e (b) permita a quebra de linha na coluna 1 também, alternando de um tipo de coluna l
para um p
tipo de coluna. Para permitir uma quebra de linha no cabeçalho da coluna 1, sugiro que você mude Place/Transition
para Place\slash Transition
.
Ao trabalhar com a classe de documento IEEEtran, sugiro ainda que você empregue um pacote, como newtxmath
, que fornece uma fonte Times Romanfonte matemática. Eu também tentaria dar à mesa uma "aparência" mais aberta e convidativa, eliminando todas as linhas verticais e criando menos linhas horizontais, mas bem espaçadas.
\documentclass[journal]{IEEEtran}
\usepackage{newtxtext,newtxmath} % Times Roman text and math fonts
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{ragged2e} % for \RaggedRight macro
\newlength\mylen
\settowidth\mylen{Transition} % target width of column 1
\begin{document}
%\renewcommand{\arraystretch}{1.25} % <-- I wouldn't do that
\noindent
\begin{tabularx}{\columnwidth} {@{}
>{\RaggedRight}p{\mylen}
>{\RaggedRight}X
c @{}}
\toprule
Place\slash Transition & Explanation & Time \\
\midrule
$T_1$ and $T_{2(n+1)}$ &
Robot operation which relates to loadlocks. Transition $T_1$ indicates that wafer unloading from the loadlocks, and $T_{2(n+1)}$ means that the robot loads the wafer to the loadlocks. &
$w$ \\
\addlinespace
item 31 & item 32 & item 33 \\
\bottomrule
\end{tabularx}
\end{document}