
Atualmente tenho uma tabularx
tabela com quatro colunas. Eu inicializo o ambiente assim:
\begin{tabularx}{\linewidth}{l p{0.4\linewidth} | l X l X}
Como eu poderia mudar isso para que a segunda coluna ( p{0.4\linewidth}
) se estendesse até, mas não passasse, do centro da página?
Responder1
Com duas tabelas sucessivas?
\documentclass{article}
\usepackage{tikz}
%---------------------------------------------------------------%
\usepackage{booktabs,tabularx,calc}
\usepackage[active,floats,tightpage]{preview}
\setlength\PreviewBorder{1em}
\begin{document}
\begin{table}
\begin{tabularx}{0.5\linewidth}{lX@{}} %%% first table
\hline
1. column & 2. column \\
1. column & 2. column \\
\hline
\end{tabularx}%
\begin{tabularx}{0.5\linewidth}{|lXX} %%% second table
\hline
3. column & 4. column & 5.column \\
3. column & 4. column & 5.column \\
\hline
\end{tabularx}
\end{table}
\end{document}
Editar: Graças ao Mico estou repensando minha resposta. O exemplo acima funciona apenas se você tiver apenas uma linha nas células da segunda coluna. Caso nesses cels haja um texto mais longo, a solução possível é colocar tabela em tabela:
\documentclass{article}
%---------------------------------------------------------------%
\usepackage{booktabs,tabularx,calc}
\usepackage[active,floats,tightpage]{preview}
\setlength\PreviewBorder{1em}
\begin{document}
\begin{table}
\begin{tabularx}{\linewidth}{@{}l|lXX}
\hline
{\begin{tabularx}{0.5\linewidth}{lX} %%% first table in table
1. & 2. column, but this doesn't work,
if the content of this cell is very long,
i.e. spread over more line
\end{tabularx}}
& 3. & 4. column & 5. column \\
\hline
{\begin{tabularx}{0.5\linewidth}{lX} %%% second table in table
1. & 2. column, with short text
\end{tabularx}}%
& 3. & 4. column & this column also can has
longer text span over more lines\\
\hline
\end{tabularx}
\end{table}
\end{document}
Agora devo confessar que não tenho mais certeza, se você gosta daquele segundo cill termine sempre no meio da página (texto).