When I type more than 3 lines of text in the table, the table collapses, could anyone help?
Here is the code:
\documentclass{report}
\usepackage[utf8]{inputenc}
\usepackage{graphicx} % Required for inserting images
\usepackage{setspace}% for\doublespacing
\usepackage{indentfirst}% for indent the first line
\usepackage{longtable}
\usepackage{textalpha}
\usepackage{ragged2e}
\usepackage[T1]{fontenc} % <-- new
\usepackage{xltabular}
\usepackage{amsmath}
\usepackage{caption}
\begin{document}
\newcolumntype{L}{>{\RaggedRight}X} % suspend full justification
% special new column type for header row:
\newcolumntype{C}{>{\centering\arraybackslash}%
p{\dimexpr\textwidth-2\tabcolsep-2\arrayrulewidth\relax}}
\begin{xltabular}{\textwidth}{ | l | L | c | } % <-- new
%% headers and footers
\caption{DUSP genes in normal and pathological brain function\label{long4}}\
\hline
\multicolumn{3}{ | C | }{DUSP genes in normal and pathological brain function}\
\hline
Isoforms & Function in Normal Brain & Function in Pathological Brain \
\hline
\endfirsthead
\hline
\multicolumn{3}{|c|}{Continuation of Table \ref{long4}}\
\hline
Isoforms & Function in Normal Brain& Function in Pathological Brain \
\hline
\endhead
\hline
\endfoot
\hline
\multicolumn{3}{| c |}{End of Table}\
\hline
\hline
\endlastfoot
SSH1 & long text long text long text long text long text long text & long textlong text long text long text \
SSH2 & long text long text long text long text & long text long text long text long text \
SSH1 & long text long text long text long text long text long text & long textlong text long text long text long textlong text long text long text \
\end{xltabular}
% This is footnote
\begin{minipage}{10cm}
\small AD: Alzheimer’s disease; HD: Huntingdon’s disease; CMT4: Charcot-Marie-Tooth Neuropathy Type 4.
\end{minipage}
\end{document}
This is ideal form.
The code gives collapsed table:










cdoesn't allow line breaks. Do you really want that third column center aligned? – Teepeemm Aug 02 '23 at 20:40