I have this code:
\documentclass{article}
\usepackage{lipsum}
\begin{document}
\begin{tabular}{ |c|c| }
\hline
\multicolumn{2}{|c}{\lipsum[1]}\\
\hline
text text text text text text & text text text text\\
\hline
\end{tabular}
\end{document}
It generates this:
How to make top cell fit the page size, like with X column format?
Here is the code, based upon Mico's example. It creates a page-wide table with a column to the left of multicolumn. (The adjustment of 1.2pt
is there to account for the three vertical lines, each 0.4pt
wide, that contribute to the total width of the tabularx
environment.)
\documentclass{article}
\usepackage{lipsum,tabularx,calc,fullpage}
\newcolumntype{Y}{>{\centering\arraybackslash}X} % centered version of "X" column type
\begin{document}
\noindent
\begin{tabularx}{\textwidth}{|p{3cm}|Y|Y|}
\hline
text text text text text &
\multicolumn{2}{p{\dimexpr\textwidth -1.2pt - 4\tabcolsep-3cm}|}{\lipsum[1]}\\
\hline
&text text text text text text & text text text text\\
\hline
\end{tabularx}
\end{document}
c
-type columns. Replacec
byp{\textwidth}
in the\multicolumn
command.