1

I made a table using the tabu environment. The code is attached below. There are two things I don't know how to fix. 1. The table width exceeds the page width. 2. how to change the vertical alignment for the first A and B and G and H...What I also don't understand is why construction types occupy two rows. Any help would be appreciated. Have been stuck here for two days. The table I intend to make is attached at last. (I made the second table using the tabular environment. However, I couldn't make it work in longtable environment so I tried to switch to tabu environment and hope longtabu will work.)

\documentclass{article}

\usepackage{amsmath,amsfonts,amssymb,amsthm}
\usepackage{tabu}
\usepackage{longtable}
\usepackage{makecell,interfaces-makecell}
\usepackage{multirow}

\begin{document}

\begin{tabu} {|X[cm]|X[cm]|X[cm]|X[cm]|X[cm]|X[cm]|X[cm]|X[cm]|}
\hline
\multicolumn2{|c|}{A} & B &\multicolumn5{|c|}{
\begin{tabu}spread 0pt{*5X[cm]}
{Construction Types}\\\hline
A & B & C & D& E\\
\end{tabu}}
\tabuphantomline
\hline
\multicolumn2{|c|}{
    \begin{tabu}spread \linewidth{X[cm]|X[cm]}
    $[$+animate$]$ & A\\\hline
    $[$-animate$]$ & B\\
    \end{tabu}}
& G & H & I & J & \\
\hline
\tabuphantomline
\end{tabu}

\end{document}

enter image description here

enter image description here

2

I would probably stick to longtable. I would also probably take the advice of booktabs to heart and dispense with the vertical rules. This is not, however, to everyone's taste and sometimes your own taste is, in any case, irrelevant in the face of institutional requirements. Hence, two possibilities:

Two Possibilities

\documentclass{article}
\usepackage{array,longtable}
\usepackage{multirow}
\usepackage{booktabs}
\newcolumntype{C}{>{$}c<{$}}

\begin{document}

\begin{longtable}{|C|c||*{6}{c|}}
  \hline
    \multicolumn{2}{|c||}{\multirow{2}*{causer}} & \multirow{2}*{Predicates} & \multicolumn{5}{c|}{Construction Types}\\\cline{4-8}
    \multicolumn{2}{|c||}{}  &  & plama & plamb & plamchoa & plamchob & plamchoc    \\\hline
    [+animate] &    &   &   &   &   & &     \\\cline{1-2}\cline{4-8}
    [-animate] &    &   &   &   &   & &     \\\hline
    [+animate] &    &   &   &   &   & &     \\\cline{1-2}\cline{4-8}
    [-animate] &    &   &   &   &   & &     \\\hline
    [+animate] &    &   &   &   &   & &     \\\cline{1-2}\cline{4-8}
    [-animate] &    &   &   &   &   & &     \\\hline
\end{longtable}

\begin{longtable}{C*{7}{c}}
  \toprule
    \multicolumn{2}{c}{\multirow{2}*{causer}} & \multirow{2}*{Predicates} & \multicolumn{5}{c}{Construction Types}\\\cmidrule{4-8}
    \multicolumn{2}{c}{}  & & plama & plamb & plamchoa & plamchob & plamchoc    \\\midrule
    {[+animate]} &  &   &   &   &   & &     \\\cmidrule{1-2}\cmidrule{4-8}
    {[-animate]} &  &   &   &   &   & &     \\\midrule
    {[+animate]} &  &   &   &   &   & &     \\\cmidrule{1-2}\cmidrule{4-8}
    {[-animate]} &  &   &   &   &   & &     \\\midrule
    {[+animate]} &  &   &   &   &   & &     \\\cmidrule{1-2}\cmidrule{4-8}
    {[-animate]} &  &   &   &   &   & &     \\\bottomrule
\end{longtable}

\end{document}
1

Here are some observations to the OP's concerns after hand-on experiments/studies.

Q1/A1. A line in tabu environment with spead \linewith caused the table width to exceed the paper margin.

Q2/A2. For vertical alignment, multirow and raisebose[-x\baselineskip]{content} are used for A,B and G,H.

Q3/A3. it takes \multicolumn{5}{c}{Construction Types} to stay in one row.

Q4/A4. Use of longtabu is feasible only if the tabu environments residing in cells are tabu. That is, only the outer most tabu environment be longtabu. (See the second example)

enter image description here

Code:

\documentclass{article}
\usepackage[margin=1cm]{geometry}
\usepackage{amsmath,amsfonts,amssymb,amsthm}
\usepackage{tabu}
\usepackage{longtable}
\usepackage{makecell,interfaces-makecell}
\usepackage{multirow}

\begin{document}

\tabulinesep=0.5mm
%
\begin{tabu} spread 10cm{|X[cm]|X[cm]|X[cm]|X[cm]|X[cm]|X[cm]|X[cm]|X[cm]|}\hline
\multicolumn{2}{|c|}{\multirow{1}{*} {A}} & \multicolumn{1}{c|} {\multirow{1}{*} {B}} &\multicolumn{5}{c|}{
\begin{tabu} spread 5cm {*5X[cm]}
\multicolumn{5}{c}{Construction Types}\\ \tabucline-
A  & B & C & D& E\\
\end{tabu}
}\\ \tabucline-
%\tabuphantomline
\multicolumn{2}{|c|}{
\begin{tabu} spread 0cm{X[cm]|X[cm]}
$[$+animate$]$ & A\\\tabucline-
$[$-animate$]$ &  B\\
\end{tabu}
}
&&\raisebox{-1.5\baselineskip} {G} &\raisebox{-1.5\baselineskip} {H} & I & J & K\\\hline
%\tabuphantomline
\end{tabu}

\vspace{2cm}   % second example 

\tabulinesep=0.5mm
\begin{longtabu} spread 0pt  {|X[cm]||X[cm]|X[cm]|X[cm]|X[cm]|X[cm]|X[cm]|}
\hline
\multicolumn{1}{|c||}{\multirow{2}{*}{causer}}  & \multicolumn{1}{c|}{\multirow{2}{*}{Predicates}}  &     
\multicolumn{5}{c|}{Construction Types} \\ \cline{3-7}
& & plama &plamb & plamchoa & plamchob& \multicolumn{1}{c|}{plamchoc}\\
\tabucline-
\multicolumn{1}{|c||}{
    \begin{tabu} spread 0pt {X[10,cm]|X[1,cm]}
    $[+animate]$ & \\ \tabucline-
    $[-animate]$ &\\ 
    \end{tabu}
}
 & &  &  &  & & \\
\tabucline-
\multicolumn{1}{|c||}{
    \begin{tabu} spread 0pt{X[10,cm]|X[1,cm]}
    $[+animate]$ & \\ \tabucline-
    $[-animate]$  & \\ 
    \end{tabu}}
 &  &  &  &   & & \\  \tabucline-

\multicolumn{1}{|l||}{
    \begin{tabu} spread 0pt{X[10,cm]|X[cm]}
    $[+animate]$ & \\ \tabucline-
    $[-animate]$ & \\ 
    \end{tabu}}
 & & &  &   & &    \\ \tabucline-
\end{longtabu}
\end{document}

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.