I'd like to save the following table as png. I've tried this and using the Linux program convert, but both saved the whole page instead of just the table. I want to save just the table as png.
How can I do this?
\documentclass[11pt]{article}
\usepackage[table]{xcolor}
\definecolor{myblue}{RGB}{78, 126, 222}
\usepackage{multirow}
\usepackage{geometry}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{ragged2e}
\begin{document}
\begin{table}[ht]
\centering\setlength{\extrarowheight}{3pt}
\rowcolors{1}{myblue}{}
\begin{tabularx}{\textwidth}{>{\cellcolor{white}} c >{\cellcolor{white}}c>{\RaggedRight\arraybackslash}X>{\RaggedRight\arraybackslash}X}
\toprule
& Inner index 1.1 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\\
\multirow{-2}{*}{Outer index 1} & Inner index 1.2 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\\
\midrule
& Inner index 2.1 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\\
\multirow{-2}{*}{Outer index 2} & Inner index 2.2 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\\
\midrule& Inner index 3.1 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\\
&Inner index 3.2 & \multicolumn{2}{>{\hsize=\dimexpr2\hsize+2\tabcolsep+\arrayrulewidth\relax\RaggedRight\arraybackslash}X}{Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\\
&Inner index 3.3 & \multicolumn{2}{>{\hsize=\dimexpr2\hsize+2\tabcolsep+\arrayrulewidth\relax\RaggedRight\arraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\\
\multirow{-2}{*}{Outer index 3}&Inner index 3.4 & \multicolumn{2}{>{\hsize=\dimexpr2\hsize+2\tabcolsep+\arrayrulewidth\relax\RaggedRight\arraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\\
&Inner index 3.5 & \multicolumn{2}{>{\hsize=\dimexpr2\hsize+2\tabcolsep+\arrayrulewidth\relax\RaggedRight\arraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\\
&Inner index 3.6 & \multicolumn{2}{>{\hsize=\dimexpr2\hsize+2\tabcolsep+\arrayrulewidth\relax\RaggedRight\arraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\\
\bottomrule
\end{tabularx}
\end{table}
\end{document}
table
environment and just have the tabular, and usestandalone
class notarticle
and the page will be resized to the table, the class has options to auto-generate the image formats as well