1

I have a question about vertical dots, generally, I'm now using \vdot in a table to express omit, but I want them to be centralized to express omit, the current codes are shown below:

\documentclass{article}

\usepackage{amssymb} % Add \usepackage{bbding} % Add \usepackage[export]{adjustbox} \usepackage{array} \usepackage{tabularx} \usepackage{booktabs} \usepackage{graphicx} \usepackage{cellspace} \def\tabularxcolumn#1{m{#1}}

\begin{document}

\begin{table}[htbp] \caption{Text.} \begin{tabularx}{\textwidth}{ l Sl X } \toprule Iterations & Samples & Comments \ \midrule 0 & $\includegraphics[width=.6\textwidth,valign=M]{000000.png}$ & Text is always being here\ 32 & $\includegraphics[width=.6\textwidth,valign=M]{000000.png}$ & Text \ 64 & $\includegraphics[width=.6\textwidth,valign=M]{000000.png}$ & Text \ 128 & $\includegraphics[width=.6\textwidth,valign=M]{000000.png}$ & Text \ 192 & $\includegraphics[width=.6\textwidth,valign=M]{000000.png}$ & Text \ \vdots & \vdots & \vdots \ 3200 & $\includegraphics[width=.6\textwidth,valign=M]{000000.png}$ & Text \ \bottomrule \end{tabularx} \label{tab4} \end{table}

\end{document}

I had tried to use \usepackage{mathtools} but it seems not to work, is there anyone familiar with this? Thanks in advance!

Tim
  • 111

1 Answers1

3

A couple of problems:

  • the siunitx package is missing

  • the number of columns specified and actually in the table does not match

  • the S column is missing instructions how to align the numbers

  • to centre your vdots while the rest of the column is justified, you can use the \makecell macro from the package of the same name

  • images are not math, don't put them in math mode


\documentclass{article}

\usepackage{amssymb} % Add \usepackage{bbding} % Add \usepackage[export]{adjustbox} \usepackage{array} \usepackage{tabularx} \usepackage{booktabs} \usepackage{graphicx} %\usepackage{cellspace} \def\tabularxcolumn#1{m{#1}} \usepackage{siunitx} \usepackage{makecell}

\begin{document}

\begin{table}[htbp] \caption{Text.} \begin{tabularx}{\textwidth}{ @{} S[table-format=4.0] c X @{} } \toprule {Iterations} & Samples & Comments \ \midrule 0 & \includegraphics[width=.6\textwidth,valign=M]{example-image-duck} & Text is always being here\ 32 & \includegraphics[width=.6\textwidth,valign=M]{example-image-duck} & Text \ {$\vdots$} & $\vdots$ & \makecell[c]{$\vdots$} \ 3200 & \includegraphics[width=.6\textwidth,valign=M]{example-image-duck} & Text \ \bottomrule \end{tabularx} \label{tab4} \end{table}

\end{document}

enter image description here

  • Thanks for your fast and detailed reply! I only have one more question, why should we comment \usepackage{cellspace}, because if this, the gap between different rows is missing...... – Tim Nov 29 '21 at 20:09
  • And is there any way to also left-align the "Samples"? If possible. – Tim Nov 29 '21 at 20:18
  • use an l column to left align them, but all your images have the same width, so it should not matter. – samcarter_is_at_topanswers.xyz Nov 29 '21 at 20:34