Anzeige:
Ergebnis 1 bis 4 von 4

Thema: Multirow und Tabelle

  1. #1
    Registrierter Benutzer
    Registriert seit
    08.08.2007
    Beiträge
    34

    Multirow und Tabelle

    Hallo,

    hab da mal wieder ein für mich unlösbares Problem und bräuchte da mal wieder eure Hilfe.

    Also ich hab eine Tabelle, bei der ich mehrere Zeilen zusammenfügen will. Komischerweise funktioniert aber multirow nicht...
    Multicolumn funktioniert dagegen aber richtig...

    Hier mal der Code:

    \usepackage{longtable}
    \usepackage{rotating}
    \usepackage{multirow}



    \begin{sidewaystable}[htp]
    \begin{longtable}{|l|l|l|l|l|l|l|l|l|l|l|l|l|l|}
    \hline
    & \textit{} & \multicolumn{2}{c|}{} & \multicolumn{2}{c|}{} & \multicolumn{2}{c|}{} & \multicolumn{2}{c|}{} & \multicolumn{2}{c|}{} & \multicolumn{2}{c|}{} \\
    \hline
    \multirow{5}{*}{\rotatebox{90}{test}} & \textit{sampling [s]} & 0.5 & 1 & 0.5 & 1 & 0.5 & 1 & 0.5 & 1 & 0.5 & 1 & 0.5 & 1 \\
    \hline
    & \textit{} & & & & & & & & & & & &\\
    \hline
    & \textit{} & & & & & & & & & & & &\\
    \hline
    & \textit{} & & & & & & & & & & & &\\
    \hline
    & \textit{} & & & & & & & & & & & &\\
    \hline
    & \textit{} & & & & & & & & & & & &\\
    \hline
    & \textit{} & & & & & & & & & & & &\\
    \hline
    & \textit{} & & & & & & & & & & & &\\
    \hline
    & \textit{} & & & & & & & & & & & &\\
    \hline
    & \textit{} & & & & & & & & & & & &\\
    \hline
    & \textit{} & & & & & & & & & & & &\\
    \hline
    & \textit{} & & & & & & & & & & & &\\
    \hline
    & \textit{} & & & & & & & & & & & &\\
    \hline
    \caption[]{\textbf{ } }
    \label{tableatient_data}
    \end{longtable}
    \end{sidewaystable}


    Viele Dank für eure Hilfe.

    Elmyra

  2. #2
    Registrierter Benutzer
    Registriert seit
    09.07.2004
    Beiträge
    2.365
    Ich kann nicht eindeutig erkennen, wie Deine Tabelle aussehen soll. Eins ist allerdings klar: Du hast multirow noch nicht verstanden.
    Vermutlich denkst Du es so:

    \documentclass{article}
    \usepackage{longtable}
    \usepackage{rotating}
    \usepackage{multirow}
    \usepackage{booktabs}
    \begin{document}

    \begin{longtable}{|l|l|l|l|l|l|l|l|l|l|l|l|l|l|}\h line
    & \textit{sampling [s]}
    & 0.5 & 1 & 0.5 & 1 & 0.5 & 1 & 0.5 & 1 & 0.5 & 1 & 0.5 & 1 \\\hline
    \multirow{5}{*}{\rotatebox{90}{test}}
    & \textit{} & & & & & & & & & & & &\\\cline{2-14}
    & \textit{} & & & & & & & & & & & &\\\cline{2-14}
    & \textit{} & & & & & & & & & & & &\\\cline{2-14}
    & \textit{} & & & & & & & & & & & &\\\cline{2-14}
    & \textit{} & & & & & & & & & & & &\\\hline
    \end{longtable}

    \end{document}

    Ob Du die vertikalen Striche brauchst, damit keine Tabelle, die Du ja eigentlich willst, sondern eine Kästchengraphik produzierst, solltest Du nochmal überlegen. Lies auch tabsatz.pdf, wenn noch nicht geschehen.

    Es wäre ferner freundlich, wenn Du zuküftig ein vollständiges Minimalbeispiel und nicht nur Codeschnipsel anbietest.

    edico

  3. #3
    Registrierter Benutzer
    Registriert seit
    08.08.2007
    Beiträge
    34
    Hi,

    jepp, ich wei dass ich multirow nicht verstanden habe und es klappt leider auch immernoch nicht.
    Ich habe eine Tabelle, die 14 Zeilen lang ist und würde gerne die Zeilen 2-5, 6-10 und 11-14 zusammenfügen...

    Und es klappt absolut nicht....

  4. #4
    Registrierter Benutzer
    Registriert seit
    09.07.2004
    Beiträge
    2.365
    Ich verstehe nicht ganz, dass Dir das Beispiel nicht weiterhilft.

    Ich habe jetzt Dein Beispiel noch weiter vereinfacht: sidewaystable abgeschaltet, rotating rausgenommen, die Spalten zusammengefasst, die 'meisten' Striche eliminiert... Warum Du longtable wählst, ist mir bei der Grösse der Tabelle nicht verständlich. An sich bietet sich tabularx an; diese Adaption überlass ich Dir.

    An sich sollte Dir nun die Erweiterung des Beispieles eine Anwendung auf Deine Tabelle unschwer gelingen.

    edico

    PS.
    Habe einen Fehler ausgemerzt und gleichzeitig die Alternative 'tabularx' mit eingebracht:

    \documentclass{article}
    \usepackage{tabularx,longtable}
    \usepackage{rotating}
    \usepackage{multirow}
    \usepackage{booktabs,array,calc}
    \begin{document}
    \noindent ANFANG\,\hrulefill\,ENDE\vskip2\baselineskip

    \subsection*{tabularx}

    {\small
    \begin{table}[htb]
    \begin{tabularx}{\linewidth}
    {@{}X
    %*{1}{p{0.10\linewidth-2\tabcolsep}}
    *{1}{p{0.19\linewidth-2\tabcolsep}}
    *{12}{p{0.06\linewidth-2\tabcolsep}}@{}
    }\hline
    &
    \textit{} &
    \multicolumn{2}{c}{A} &
    \multicolumn{2}{c}{B} &
    \multicolumn{2}{c}{C} &
    \multicolumn{2}{c}{D} &
    \multicolumn{2}{c}{E} &
    \multicolumn{2}{c}{F} \\\hline
    & \textit{sampling [s]}
    & 0.5 & 1 & 0.5 & 1 & 0.5 & 1 & 0.5 & 1 & 0.5 & 1 & 0.5 & 1 \\\hline
    \multirow{5}{.1\linewidth}{{testing\newline the\newline test}}
    & \textit{} & & & & & & & & & & & &\\%\cline{2-14}
    & \textit{} & & & & & & & & & & & &\\%\cline{2-14}
    & \textit{} & & & & & & & & & & & &\\%\cline{2-14}
    & \textit{} & & & & & & & & & & & &\\%\cline{2-14}
    & \textit{} & & & & & & & & & & & &\\\hline
    \multirow{5}{.1\linewidth}{{testing\newline the\newline test}}
    & \textit{} & & & & & & & & & & & &\\%\cline{2-14}
    & \textit{} & & & & & & & & & & & &\\%\cline{2-14}
    & \textit{} & & & & & & & & & & & &\\%\cline{2-14}
    & \textit{} & & & & & & & & & & & &\\%\cline{2-14}
    & \textit{} & & & & & & & & & & & &\\\hline
    \multirow{5}{.1\linewidth}{{testing\newline the\newline test}}
    & \textit{} & & & & & & & & & & & &\\%\cline{2-14}
    & \textit{} & & & & & & & & & & & &\\%\cline{2-14}
    & \textit{} & & & & & & & & & & & &\\%\cline{2-14}
    & \textit{} & & & & & & & & & & & &\\%\cline{2-14}
    & \textit{} & & & & & & & & & & & &\\\hline
    \end{tabularx}
    \caption[]{\textbf{tabularx}}
    \label{tab:ta}
    \end{table}
    }

    \subsection*{longtable}
    {\small
    %\begin{longtable}{llllllllllllll}\hline
    %\begin{longtable}{*{14}{l}}\hline
    \begin{longtable}{@{}*{1}{p{0.10\linewidth-2\tabcolsep}}
    *{1}{p{0.18\linewidth-2\tabcolsep}}
    *{12}{p{0.06\linewidth-2\tabcolsep}}@{}
    }\hline
    &
    \textit{} &
    \multicolumn{2}{c}{A} &
    \multicolumn{2}{c}{B} &
    \multicolumn{2}{c}{C} &
    \multicolumn{2}{c}{D} &
    \multicolumn{2}{c}{E} &
    \multicolumn{2}{c}{F} \\\hline
    & \textit{sampling [s]}
    & 0.5 & 1 & 0.5 & 1 & 0.5 & 1 & 0.5 & 1 & 0.5 & 1 & 0.5 & 1 \\\hline
    \multirow{5}{.1\linewidth}{{testing\newline the\newline test}}
    & \textit{} & & & & & & & & & & & &\\%\cline{2-14}
    & \textit{} & & & & & & & & & & & &\\%\cline{2-14}
    & \textit{} & & & & & & & & & & & &\\%\cline{2-14}
    & \textit{} & & & & & & & & & & & &\\%\cline{2-14}
    & \textit{} & & & & & & & & & & & &\\\hline
    \multirow{5}{.1\linewidth}{{testing\newline the\newline test}}
    & \textit{} & & & & & & & & & & & &\\%\cline{2-14}
    & \textit{} & & & & & & & & & & & &\\%\cline{2-14}
    & \textit{} & & & & & & & & & & & &\\%\cline{2-14}
    & \textit{} & & & & & & & & & & & &\\%\cline{2-14}
    & \textit{} & & & & & & & & & & & &\\\hline
    \multirow{5}{.1\linewidth}{{testing\newline the\newline test}}
    & \textit{} & & & & & & & & & & & &\\%\cline{2-14}
    & \textit{} & & & & & & & & & & & &\\%\cline{2-14}
    & \textit{} & & & & & & & & & & & &\\%\cline{2-14}
    & \textit{} & & & & & & & & & & & &\\%\cline{2-14}
    & \textit{} & & & & & & & & & & & &\\\hline
    \multirow{5}{.1\linewidth}{{testing\newline the\newline test}}
    & \textit{} & & & & & & & & & & & &\\%\cline{2-14}
    & \textit{} & & & & & & & & & & & &\\%\cline{2-14}
    & \textit{} & & & & & & & & & & & &\\%\cline{2-14}
    & \textit{} & & & & & & & & & & & &\\%\cline{2-14}
    & \textit{} & & & & & & & & & & & &\\\hline
    \multirow{5}{.1\linewidth}{{testing\newline the\newline test}}
    & \textit{} & & & & & & & & & & & &\\%\cline{2-14}
    & \textit{} & & & & & & & & & & & &\\%\cline{2-14}
    & \textit{} & & & & & & & & & & & &\\%\cline{2-14}
    & \textit{} & & & & & & & & & & & &\\%\cline{2-14}
    & \textit{} & & & & & & & & & & & &\\\hline
    \caption[]{\textbf{longtable}}
    \label{tab:lo}
    \end{longtable}
    }

    \end{document}
    Geändert von edico (18-10-2007 um 17:30 Uhr)

Lesezeichen

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •