1

I found this answer with search: https://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}
  • 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 '14 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 '14 at 20:44
  • The default alignment of a tabular is vertically [c]entred. There is no [x] alignment. – Werner Jun 3 '14 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 '14 at 9:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.