I am trying to get a figure and a table next to eachother but they aren't staying together. In my document the figure ends up somewehere else but the table stays where I want it to be, as if the h in the \begin{figure}[h] isnt working.
The caption for the table has to be above the table and the caption for the figure has to be under the figure.
My code as of now:
\begin{figure}[h]
\parbox{7cm}{
\centering
\includegraphics[height=3.5cm, width=6.5cm{Kapitler/Metode/Linersammenhang.png}
\caption{Lineærsammenhæng mellem erstatningsgrad og cementindhold}
\label{fig:linersammenhang}
}
\begin{table}[h]
\parbox{7cm}{
\centering
\caption{Tabel over cementindhold for hver erstatningsgrad udregnet vha. den lineærsammenhæng}
\label{tab:cementindhold}
\begin{tabular}{cc}
\hline
\begin{tabular}[c]{@{}c@{}}Erstatningsgrad\\ {[}\%{]}\end{tabular} & \begin{tabular}[c]{@{}c@{}}Cementindhold\\ $[\frac{kg}{m^3}]$\end{tabular} \\
\hline
0 (REF) & 222,4 \\
10 & 227,8 \\
30 & 238,8 \\
100 & 277,0 \\ \hline
\end{tabular}
}
\end{table}
\end{figure}
Hope someone is able to find a solution :)
