I am generating some table as follow:
\begin{tabular}[l]{|l|l|l|}
\hline
Input & Output& Action return \\
\hline
\hline
DNF & simulation & jsp\\
\hline
\end{tabular}
How can can I give this table the same width as the text width? For graphic I use
[width=\textwidth]
But this doesn't work for table.
This question is related to
latex
The tabularx
package gives you
X
, all X
columns will grow to fill up the total width.For your example:
\usepackage{tabularx}
% ...
\begin{document}
% ...
\begin{tabularx}{\textwidth}{|X|X|X|}
\hline
Input & Output& Action return \\
\hline
\hline
DNF & simulation & jsp\\
\hline
\end{tabularx}
Source: Stackoverflow.com