[Tex/LaTex] Copy/paste code from Overleaf to LaTeX

tables

I'm a rookie so I copied/pasted code from a document/template which I found on Overleaf.com to my LaTeX document, in hope of getting the table shown below. However, it did not work as intended.

\documentclass[num-refs]{wiley-article}

I believe the above might be the cause of the problem (?)

TABLE 1

Here is the code:

\documentclass[num-refs]{wiley-article}

\usepackage{siunitx}
\usepackage{graphicx}
\usepackage[para,online,flushleft]{threeparttable}

\begin{table}[bt]
\caption{This is a table. Tables should be self-contained and complement, but not duplicate, information contained in the text. They should be not be provided as images. Legends should be concise but comprehensive – the table, legend and footnotes must be understandable without reference to the text. All abbreviations must be defined in footnotes.}
    \begin{threeparttable}
        \begin{tabular}{lccrr}
            \headrow
            \thead{Variables} & \thead{JKL ($\boldsymbol{n=30}$)} & \thead{Control ($\boldsymbol{n=40}$)} & \thead{MN} & \thead{$\boldsymbol t$ (68)}\\
            Age at testing & 38 & 58 & 504.48 & 58 ms\\
            Age at testing & 38 & 58 & 504.48 & 58 ms\\
            Age at testing & 38 & 58 & 504.48 & 58 ms\\
            Age at testing & 38 & 58 & 504.48 & 58 ms\\
            \hiderowcolors
            stop alternating row colors from here onwards\\
            Age at testing & 38 & 58 & 504.48 & 58 ms\\
            Age at testing & 38 & 58 & 504.48 & 58 ms\\
            \hline  % Please only put a hline at the end of the table
        \end{tabular}

        \begin{tablenotes}
            \item JKL, just keep laughing; MN, merry noise.
        \end{tablenotes}
    \end{threeparttable}

source: https://www.overleaf.com/13040643kzzrjnxqfjph#/50009479/

Here is the result:

enter image description here

Best Answer

Copying just the code in the active window does not consider all the other components working with the template/project. You should copy the entire project folder to some local working folder, where you can compile the project. Following the instructions in How to download an Overleaf template?, these are all the files associated with the template:

enter image description here

This is the output for the table when compiling main.tex locally:

enter image description here

You'll have to compile with BibTeX as well if you want the bibliography working properly.