I've written the below code with the quote from this post.
\documentclass[border=0.1cm]{article}
\usepackage{diagbox}
\usepackage{makecell}
\begin{document}
\begin{table}\centering\setlength\tabcolsep{3.5pt}\renewcommand\arraystretch{1.25}
\noindent\makebox[\textwidth]{%
\begin{tabular}{|l|*{3}{c|}}
\hline
\diagbox[width=\dimexpr \textwidth/8+2\tabcolsep\relax, height=1cm,width=3cm]{ row }{column }
& smth1 & smth2 \\
\hline
smth3 & 1 & 2 \\
\hline
smth4& 3 & 4 \\
\hline
\end{tabular}
}
\end{table}
\end{document}
Got the below image from the above code.
As I done line break at the cell of smth3, the blank lines have appeared as shown in the below image.
How can I resolve this problem?
\documentclass[border=0.1cm]{article}
\usepackage{diagbox}
\usepackage{makecell}
\begin{document}
\begin{table}\centering\setlength\tabcolsep{3.5pt}\renewcommand\arraystretch{1.25}
\noindent\makebox[\textwidth]{%
\begin{tabular}{|l|*{3}{c|}}
\hline
\diagbox[width=\dimexpr \textwidth/8+2\tabcolsep\relax, height=1cm,width=3cm]{ row }{column }
& smth1 & smth2 \\
\hline
smth3 \\ text at 2nd row of smth3 & 1 & 2 \\ % Added "\\ text at 2nd row of smth3"
\hline
smth4& 3 & 4 \\
\hline
\end{tabular}
}
\end{table}
\end{document}




smth3you must add the two&&before the end line macro\\. – campa Aug 05 '21 at 06:39