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 found this answer with search: http://tex.stackexchange.com/a/19678/53832

Is there some way to make all cells in the table to work like this? Some of the cells in the table are multirow cells if that makes any difference.

MWE

\documentclass{article}
\usepackage[landscape]{geometry}
\usepackage{multirow}
\begin{document}
\begin{table}[ht]
\begin{tabular}{c|c|c|c}
\hline
\multirow{8}{*}{\begin{tabular}[x]{@{}c@{}}This is first line\\This is second line\end{tabular}} & \multirow{4}{*}{\begin{tabular}[x]{@{}c@{}}This is first line\\This is second line\end{tabular}} & \multirow{2}{*}{\begin{tabular}[x]{@{}c@{}}This is first line\\This is second line\end{tabular}} & \begin{tabular}[x]{@{}c@{}}This is first line\\This is second line\end{tabular} \\ [30pt] \cline{4-4}

& & & This cell should have also two lines \\ [30pt] \cline{3-4}

& & \multirow{2}{*}{This cell should have also two lines} & This cell should have also two lines \\ [30pt] \cline{4-4}

& & & \begin{tabular}[x]{@{}c@{}}This is first line\\This is second line\end{tabular} \\ [30pt] \cline{2-4}

& This cell should have also two lines & \multirow{2}{*}{\begin{tabular}[x]{@{}c@{}}This is first line\\This is second line\end{tabular}} & This cell should have also two lines \\ [30pt] \cline{4-4}

& & & This cell should have also two lines \\ [30pt]
\hline
\end{tabular}
\end{table}
\end{document}
share|improve this question
1  
Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  Adam Liter Jun 3 at 16:43
    
Because this was more like technical question and I didn't have any example and thought that all the info was available I didn't include MWE. –  Juhana Jun 3 at 20:44
    
The default alignment of a tabular is vertically [c]entred. There is no [x] alignment. –  Werner Jun 3 at 21:31
    
@Werner Again. This is just something I threw together because it was asked, so those lines are just c+p from the answer that I linked in my question –  Juhana Jun 4 at 9:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.