2

In the following file I have a table with insertion of figures.

I want to vertically center the cell contents. Only the cells in the second and third rows. But I do not want to leave intact the column width. The column width you want to make it automatic, which decides latex. Also, I do not want to alter the height of the rows.

How could he do?

Thanks.

The file displayed here compiles correctly and the output is shown in the image below.

\documentclass[12pt]{report}
\usepackage{array}
\usepackage{amsmath}
\begin{document}
\begin{tabular}{| >{$}c<{$} | c | c | c | c | c | c |c |}
\cline{2-8}
\multicolumn{1}{c}{}&\multicolumn{7}{|c|}{\rule{0mm}{0.4cm}{figure1 put here}}\\ \hline
\rule{0mm}{1.2cm} x & -0.01 & -0.001 & -0.0001 & 0 & 0.0001 & 0.001 & 0.01 \\\hline
\rule{0mm}{1.2cm} f(x) & 1.99499 & 1.9995 & 1.99995 & ? & 2.00005 & 2.0005 & 2.00499\\\hline
\multicolumn{1}{c}{}&\multicolumn{7}{|c|}{\rule{0mm}{0.4cm}\text{figure2 put here}}\\\cline{2-8}
\end{tabular}
\end{document}

enter image description here

2

enter image description here

The row only appeared misaligned due to the non-symmetric rule added which had height but not depth.

\documentclass[12pt]{report}
\usepackage{array}
\usepackage{amsmath}
\begin{document}
\begin{tabular}{| >{$}c<{$} | c | c | c | c | c | c |c |}
\cline{2-8}
\multicolumn{1}{c}{}&\multicolumn{7}{|c|}{\rule{0mm}{0.4cm}{figure1 put here}}\\ \hline
\rule[-.5cm]{0mm}{1.2cm} x & -0.01 & -0.001 & -0.0001 & 0 & 0.0001 & 0.001 & 0.01 \\\hline
\rule[-.5cm]{0mm}{1.2cm} f(x) & 1.99499 & 1.9995 & 1.99995 & ? & 2.00005 & 2.0005 & 2.00499\\\hline
\multicolumn{1}{c}{}&\multicolumn{7}{|c|}{\rule{0mm}{0.4cm}\text{figure2 put here}}\\\cline{2-8}
\end{tabular}
\end{document}

Or with corrected vertical rules that line up correctly: enter image description here

\documentclass[12pt]{report}
\usepackage{array}
\usepackage{amsmath}
\begin{document}
\begin{tabular}{| >{$}c<{$} | c | c | c | c | c | c |c |}
\cline{2-8}
\multicolumn{1}{c|}{}&\multicolumn{7}{c|}{\rule{0mm}{0.4cm}{figure1 put here}}\\ \hline
\rule[-.5cm]{0mm}{1.2cm} x & -0.01 & -0.001 & -0.0001 & 0 & 0.0001 & 0.001 & 0.01 \\\hline
\rule[-.5cm]{0mm}{1.2cm} f(x) & 1.99499 & 1.9995 & 1.99995 & ? & 2.00005 & 2.0005 & 2.00499\\\hline
\multicolumn{1}{c|}{}&\multicolumn{7}{c|}{\rule{0mm}{0.4cm}\text{figure2 put here}}\\\cline{2-8}
\end{tabular}
\end{document}

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.