1

Currently I am trying to make my tables look prettier (or rather say, easier to read), so I was wondering how to set a column in a way that it can perform line-breaks automatically within one cell than the overall row space.

\documentclass[
  12pt,
  a4paper,
  headings=standardclasses,
  listof=totoc,
  numbers=noenddot
]{scrartcl}

\usepackage{showframe}
\usepackage[left=2.50cm, right=2.50cm, top=2.50cm, bottom=2.00cm, footskip=1cm]{geometry}
\usepackage[onehalfspacing]{setspace}
\usepackage[main=ngerman, english]{babel}
\usepackage[babel, german=quotes]{csquotes}
\usepackage[ngerman]{isodate}
\usepackage[ngerman]{datetime}
%----------------------------------------------------------------------------
%   TABLES
%----------------------------------------------------------------------------
\usepackage{array}
\newcolumntype{P}[1]{>{\raggedleft\arraybackslash}p{#1}}
\usepackage{arydshln}
\setlength\dashlinedash{0.2pt}
\setlength\dashlinegap{1.5pt}
\setlength\arrayrulewidth{0.3pt}
\renewcommand{\arraystretch}{1.5}
\usepackage{booktabs}


\begin{document}
\begin{table}[htb]
\centering
\caption {Analyse-Ebenen zum \glq Frame\grq -Verständnis}
\begin{tabular}{@{}llll@{}}
\toprule
                     &     & Ebene           & Aspekt                                                                                                             \\ \midrule
0                    &     & formal          & terminologische Vereinbarkeit                                                                                      \\ \hdashline
1                    &     & ontologisch     & Verhältnis von kognitiven und Wirklichkeitsstrukturen        \\ \hdashline
             & 1.1 & Entität         & kognitive Entität (eigene Realität) vs. formales Beschreibungsmodell \\ \hdashline
             & 1.2 & Größe           & individuell vs. kulturell                                                                                          \\ \hdashline
2                    &     & epistemologisch & repräsentierte Wissensform                                                                                         \\ \hdashline
3                    &     & strukturell     & Aufbau und Organisation                                                                                            \\ \hdashline
4                    &     & funktional      & repräsentierter Gegenstand                                                                                         \\  \bottomrule
\end{tabular}
\label{ta:analysisdimensions}
\end{table}

\end{document}

Basically, what I would like is for the last column to have line-breaks, as it is currently overflowing the page borders. Furthermore, I would like to change the line-spacing to 1 spacing for this cell only while keeping the overall sapcing at 1.5 spacing for the totality of the table. Is that possible ?

2
  • you have used l which means single line, use p{3cm} or the type you have defined here P{3cm} Commented Mar 22, 2021 at 12:29
  • thanks you're absolutely right!
    – user236381
    Commented Mar 22, 2021 at 12:35

1 Answer 1

0

With tabularx:

\documentclass[
  12pt,
  a4paper,
  headings=standardclasses,
  listof=totoc,
  numbers=noenddot
]{scrartcl}

\usepackage{showframe}
\usepackage[left=2.50cm, right=2.50cm, top=2.50cm, bottom=2.00cm, footskip=1cm]{geometry}
\usepackage[onehalfspacing]{setspace}
\usepackage[main=ngerman, english]{babel}
\usepackage[babel, german=quotes]{csquotes}
\usepackage[ngerman]{isodate}
\usepackage[ngerman]{datetime}
%----------------------------------------------------------------------------
%   TABLES
%----------------------------------------------------------------------------
\usepackage{array, tabularx}
\newcolumntype{P}[1]{>{\raggedleft\arraybackslash}p{#1}}
\usepackage{arydshln}
\setlength\dashlinedash{0.2pt}
\setlength\dashlinegap{1.5pt}
\setlength\arrayrulewidth{0.3pt}
\renewcommand{\arraystretch}{1.5}
\usepackage{booktabs}


\begin{document}
\begin{table}[htb]
\centering
\caption {Analyse-Ebenen zum \glq Frame\grq -Verständnis}
\begin{tabularx}{\linewidth}{@{}lllX@{}}
\toprule
                     &     & Ebene           & Aspekt                                                                                                             \\ \midrule
0                    &     & formal          & terminologische Vereinbarkeit                                                                                      \\ \hdashline
1                    &     & ontologisch     & Verhältnis von kognitiven und Wirklichkeitsstrukturen        \\ \hdashline
             & 1.1 & Entität         & kognitive Entität (eigene Realität) vs. formales Beschreibungsmodell \\ \hdashline
             & 1.2 & Größe           & individuell vs. kulturell                                                                                          \\ \hdashline
2                    &     & epistemologisch & repräsentierte Wissensform                                                                                         \\ \hdashline
3                    &     & strukturell     & Aufbau und Organisation                                                                                            \\ \hdashline
4                    &     & funktional      & repräsentierter Gegenstand                                                                                         \\  \bottomrule
\end{tabularx}
\label{ta:analysisdimensions}
\end{table}

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .