What is the correct way to determine the correct size for use with p{} needed by \multicolumn to get the size correct?
The problem is this: I want to use tabularx and also use \multicolumn. To do that, I have to give \multicolumn an exact size to use. And this is the problem. In complicated table, where I can have one table inside another, and a row that extends to few columns, the calculations are getting hard.
It become harder to figure the correct size, and if I change the table later, I have to change the code again.
The first example below shows that X can't be used with \multicolumn to make it extend to more than one column:
\documentclass[10pt,notitlepage]{article}%
\usepackage{tabularx}
\usepackage{array}
\newcolumntype{Y}{>{\centering\arraybackslash}X}
\usepackage{lipsum}
\setlength{\parindent}{0pt}
\begin{document}
\begin{tabularx}{\textwidth}{@{}|l|Y|@{}}\hline
column 1 &
{\begin{tabularx}{\linewidth}{@{}Y|Y|Y@{}}\hline
\lipsum[75] & \lipsum[75] & \lipsum[75] \\\hline
\multicolumn{3}{X}{\lipsum[75]}
\end{tabularx}
}
\\\hline
\end{tabularx}
\end{document}

So have to use p{}. Nothing else would let it extend to the other columns.
But p wants a size. after some trial and error, here is one that gets close to the size needed
\documentclass[10pt,notitlepage]{article}%
\usepackage{tabularx}
\usepackage{array}
\newcolumntype{Y}{>{\centering\arraybackslash}X}
\usepackage{lipsum}
\setlength{\parindent}{0pt}
\begin{document}
\begin{tabularx}{\textwidth}{@{}|l|Y|@{}}\hline
column 1 &
{\begin{tabularx}{\linewidth}{@{}Y|Y|Y@{}}\hline
\lipsum[75] & \lipsum[75] & \lipsum[75] \\\hline
\multicolumn{3}
%this calculation below is needed, and not sure if it is correct now
{p{.9\dimexpr \textwidth-4\arrayrulewidth-8\tabcolsep\relax}}{\lipsum[75]}
\end{tabularx}
}
\\\hline
\end{tabularx}
\end{document}

Ok, it is better now. But if I change something later, I have to go change .9 to something else I am sure.
The question is: Is this really how one is supposed to do this in Latex? It seems that Latex should have a way to do this automatically. Is there a better approach I should be looking at instead of what I am doing above?
The above is a small example. I want to use tabularx and have other tabularx tables inside as well. So this can get complicated very quickly.

\setlength{\hsize}{\dimexpr3\hsize+2\arrayrulewidth+4\tabcolsep\relax}should give a better result. – egreg Dec 25 '13 at 14:56\multicolumn. – egreg Dec 25 '13 at 15:05\newcolumntype{Y}[1]{>{\centering\arraybackslash\setlength\hsize{#1\hsize}}X}, then we can simply useY{}forY, andY{3}for spanning three auto sized columns. – Quar Oct 16 '20 at 17:57