I am preparing an article having a table, for a Springer journal. I am using tabularx, multirow. My table code is attached. I am not able to bring the lines 'xxxxxxxxxx xxxxxxxxxxx xxxxxxxxxxxx' and 'yyyyyyy yyyyyyyyyyyyy yyyyyyyy yyyyyyyyy' into two lines, so the lines don't cross the page boundary.
How to do that?
%\documentclass{svjour3} % onecolumn (standard format)
\documentclass[smallcondensed]{svjour3} % onecolumn (ditto)
%\documentclass[smallextended]{svjour3} % onecolumn (second format)
%\documentclass[twocolumn]{svjour3} % twocolumn
%\documentclass[12pt]{report}
%\linespread{1.5}
\huge
%
%\smartqed % flush right qed marks, e.g. at end of proof
%
%\usepackage[12pt]{extsizes}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{setspace}
\usepackage{spreadtab}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
%\usepackage{mathtools}
\title{}
\author{}
\begin{document}
\begin{table}
\caption{vvvv vvvv vvv hjgksjd ldkfjlsad}
\label{tab:2}
\begin{tabularx}{\textwidth}{ll p{1.5cm}p{1.5cm}p{1.5cm}p{1.5cm} }
\toprule
size & Type & \multicolumn{2}{c}{xxxxxxxxxx xxxxxxxxxxx xxxxxxxxxxxx} & \multicolumn{2}{c}{yyyyyyy yyyyyyyyyyyyy yyyyyyyy yyyyyyyyy} \\
\cmidrule(lr){3-4} \cmidrule(ll){5-6}
& & XYZ & P-XYZ & XYZ & P-XYZ \\
\midrule
100 & A & \\
& B & \\
& C & \\
& Ds & \\\addlinespace
200 & A & \\
& B & \\
& C & \\
& Ds & \\\addlinespace
300 & A & \\
& B &\\
& C &\\
& Ds & \\\addlinespace
400 & A & \\
& B &\\
& C \\
& Ds\\
\bottomrule
\end{tabularx}
\end{table}
\maketitle
\tableofcontents
\begin{abstract}
\end{abstract}
\section{}
\end{document}
multicolumn
you force to the cell content be in one column.