Is there a way to resize the whole `table` element? I know there is `resizebox` which can resize the `tabular` element, as discussed here: [Is there a way to slightly shrink a table, including font size, to fit within the column boundaries?](https://tex.stackexchange.com/questions/10863/is-there-a-way-to-slightly-shrink-a-table-including-font-size-to-fit-within-th). However, when I generate tables directly from R or Stata into a TeX file (which I then `input` in my code), I need to manually add the `resizebox` command around the `tabular` every time I re-generate the table. Here is a minimal (non-working but illustrative) example of what I'd like to do:

```
\documentclass{article} 
\begin{document}

\resizebox{\linewidth}{!}{
\input{table.tex}
}
\end{document}

```

where table.tex is a separate file containing only a table (this file is generated by a statistical software):

```
\begin{table}[]
\begin{tabular}{cc}
X  & Y \\
Z & A
\end{tabular}
\end{table}

```