4

MWE

\documentclass{article}
\usepackage{amsmath,tabularx}

\begin{document}

\begin{table}[h!]
\caption{Table}\label{tab:1}
\centering
\newcolumntype{C}{>{\centering\arraybackslash}X}
\begin{tabularx}{\linewidth}{ l | @{}C@{} |}%\hline
\cline{2-2}
&$R_{E}=\Biggl(\dfrac{1}{R_1}+\dfrac{1}{R_2}+\dfrac{1}{R_3}\Biggr)^{-1}$  \\ \hline
\multicolumn{1}{|p{2cm}||}{Theoretical} &  \\ \hline
\multicolumn{1}{|p{2cm}||}{Application} &  \\ \hline
\end{tabularx}
\end{table}

\end{document}

And displayed

enter image description here

The R_E line, I try to make is equal to the top and bottom spaces. Theoretical line should be 1cm and the Application line should be 2cm. The code I added adds an error. How should this code change?

6

A couple of ad hoc commands:

\documentclass{article}
\usepackage{amsmath,tabularx}

\begin{document}

\begin{table}[h!]
\caption{Table}\label{tab:1}
\centering
\newcolumntype{C}{>{\centering\arraybackslash}X}
\newcommand{\makebiggermath}[1]{%
  \sbox0{$\displaystyle#1$}%
  \makeheight{\dimexpr\ht0+\dp0+10pt}%
  \box0
}
\newcommand{\makeheight}[1]{%
  \settoheight{\dimen0}{T}% a capital letter
  \rule[-\dimexpr(#1-\dimen0)/2]{0pt}{#1}%
}
\begin{tabularx}{\linewidth}{ l | @{}C@{} |}%\hline
\cline{2-2}
&\makebiggermath{
  R_{E}=\Biggl(\dfrac{1}{R_1}+\dfrac{1}{R_2}+\dfrac{1}{R_3}\Biggr)^{-1}
}  \\ \hline
\multicolumn{1}{|p{2cm}|}{\makeheight{1cm}Theoretical} & \\ \hline
\multicolumn{1}{|p{2cm}|}{\makeheight{2cm}Application} & \\ \hline
\end{tabularx}
\end{table}

\end{document}

enter image description here

4

One possibility is to draw an invisible line (of zero width) and the desired height and depth (below the baseline).

For example \rule[-4mm]{0mm}{10mm} draws a line of zero width (therefore invisible) of 10 mm height and 4mm depth.

The command \renewcommand{\arraystretch}{1.5} allows to modify the spacing between the text of a cell and its border.

With this code:

\documentclass{article}
\usepackage{amsmath,tabularx}

\begin{document}
\renewcommand{\arraystretch}{1.5}
\begin{table}[h!]
\caption{Table}\label{tab:1}
\centering
\newcolumntype{C}{>{\centering\arraybackslash}X}
\begin{tabularx}{\linewidth}{ l | @{}C@{} |}%\hline
\cline{2-2}
&$R_{E}=\Biggl(\dfrac{1}{R_1}+\dfrac{1}{R_2}+\dfrac{1}{R_3}\Biggr)^{-1}$ \rule[-6mm]{0mm}{15mm} \\ \hline
\multicolumn{1}{|p{2cm}||}{Theoretical} & \rule[-4mm]{0mm}{10mm} \\ \hline
\multicolumn{1}{|p{2cm}||}{Application} & \rule[-4mm]{0mm}{20mm} \\ \hline
\end{tabularx}
\end{table}

\end{document}

the output is :

tableau

  • 1
    I learned new information from your MWE. – Özgür Aug 26 '18 at 16:09
4

I'm wondering why you are using \multicolumn, a solution for the Theoratical / Application part might be:

\documentclass{article}
\usepackage{amsmath,tabularx}

\begin{document}

\begin{table}[h!]
\caption{Table}\label{tab:1}
\centering
\newcolumntype{C}{>{\centering\arraybackslash}X}
\begin{tabularx}{\linewidth}{ l | @{}C@{} |}%\hline
\cline{2-2}
&$R_{E}=\Biggl(\dfrac{1}{R_1}+\dfrac{1}{R_2}+\dfrac{1}{R_3}\Biggr)^{-1}$  \\ \hline
\rule{0pt}{1cm} {Theoretical} &  \\
\hline
\rule{0pt}{2cm} {Application} &  \\
\hline
\end{tabularx}
\end{table}

\end{document}

maybe you have to have this in a "hidden cell" as now it is added to the cell.

  • The reason why I use \multicolumn is that it is a different table image. If you suggest a different table image I try to add it to my document. In the meantime @egreg has provided the exact solution I want. – Özgür Aug 26 '18 at 16:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.