Diagbox line issues with cell height
I applied a negative \raisebox
to the \diagbox
and tweaked some of the other parameters associated with the \diagbox
.
\documentclass{article}
\usepackage[a4paper,landscape, margin=0.5in]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{pifont}
\usepackage{tabularx}
\usepackage{adjustbox}
\usepackage{array}
\usepackage{diagbox}
\usepackage[table]{xcolor}
\begin{document}
\renewcommand\arraystretch{1.5}
{\rowcolors{2}{}{lightgray}
\begin{tabularx}{0.85\textwidth}{
l | >{\centering\arraybackslash}X >{\centering\arraybackslash}X >{\centering\arraybackslash}X >{\centering\arraybackslash}X}
\raisebox{-1.8em}{\textbf{\diagbox[height=4.2\line]%
{\raisebox{1em}{Feature}}{\raisebox{-0.2em}{Type of DSR}}}} &
\textbf{Manifold discussion within a community} &
\textbf{Evaluation to support information management and purchase decision} &
\textbf{Immediate discussion within a community} &
\textbf{Hybrid interaction related to sales and gratification} \\ \hline
\textbf{Content macro-category} & rating, review, discussion forum, social media post, tag, list & highlight, tooltip, comment, rating, review, tag, list & highlight, tooltip, comment (margin/footer), rating, tag & highlight, tooltip, comment (margin/footer), rating, review, social media post, tag, list \\
\textbf{Relation to source text} & external & immediate, external & immediate & immediate, external \\
\textbf{Type of audience} & group, institution, public & group, institution, public & group, institution, public & group, institution, public \\
\textbf{Timeframe} & after reading, scheduled, self-paced & after reading, self-paced & during/after reading, scheduled, self-paced & during/after reading, scheduled, self-paced \\
\textbf{Examples} & Goodreads groups and discussions, fanfiction blogs & Amazon highlights and reviews, Goodreads lists, AO3 collections, Twitter bookmarks and lists & Hypothesis groups, Wattpad, comments in fanfiction archives & Kobo Reading app gamification, bookstagram, booktubers \\
\end{tabularx}
}
\end{document}
NOTE: the apparent absence of the vertical line after the first column is a visual artifact based on the zoom level:
Here is a solution with nicematrix
. With the environment {NiceTabular}
of that extension, the vertical rule won't seem to vanish in some PDF viewers at some levels of zoom.
\documentclass{article}
\usepackage[a4paper,landscape, margin=0.5in]{geometry}
\usepackage{xcolor}
\usepackage{calc}
\usepackage{nicematrix}
\begin{document}
\newlength{\mylength}
\setlength{\mylength}{((0.85\textwidth)-\widthof{\textbf{Content macro-category}})/4}
\newcolumntype{X}{>{\centering\arraybackslash}p{\mylength}}
\NiceMatrixOptions{cell-space-top-limit=1ex,cell-space-bottom-limit=1ex}
\begin{NiceTabular}{l|XXXX}[code-before = \rowcolors{2}{}{lightgray}]
\diagbox{\hspace{5pt}\rule[-8pt]{0pt}{8pt}\textbf{Feature}}{\rule{0pt}{12pt}\textbf{Type of DSR\;}} &
\textbf{Manifold discussion within a community} &
\textbf{Evaluation to support information management and purchase decision} &
\textbf{Immediate discussion within a community} &
\textbf{Hybrid interaction related to sales and gratification} \\ \hline
\textbf{Content macro-category} & rating, review, discussion forum, social media post, tag, list & highlight, tooltip, comment, rating, review, tag, list & highlight, tooltip, comment (margin/footer), rating, tag & highlight, tooltip, comment (margin/footer), rating, review, social media post, tag, list \\
\textbf{Relation to source text} & external & immediate, external & immediate & immediate, external \\
\textbf{Type of audience} & group, institution, public & group, institution, public & group, institution, public & group, institution, public \\
\textbf{Timeframe} & after reading, scheduled, self-paced & after reading, self-paced & during/after reading, scheduled, self-paced & during/after reading, scheduled, self-paced \\
\textbf{Examples} & Goodreads groups and discussions, fanfiction blogs & Amazon highlights and reviews, Goodreads lists, AO3 collections, Twitter bookmarks and lists & Hypothesis groups, Wattpad, comments in fanfiction archives & Kobo Reading app gamification, bookstagram, booktubers \\
\end{NiceTabular}
\end{document}
However, you need several compilations because nicematrix
uses PGF/Tikz nodes.