Using \DeclareMarginSet
, you can declare a margin set allowing you to hang the object on both margins (there are predefined settings hangleft
, hangright
for each margin individually, but not for both of them simultaneouly); then, you can invoke this margin set together with an appropriate value for floatwidth
and rowfill=yes
. Something along these lines:
\documentclass{article}
\usepackage{graphicx}
\usepackage{floatrow}
\usepackage{lipsum}% just to generate text for the example
\DeclareMarginSet{hangboth}{\setfloatmargins*{\hskip-4cm}{\hskip-4cm}}
\begin{document}
\thisfloatsetup{floatwidth=\paperwidth,rowfill=yes,margins=hangboth}
\lipsum[4]
\begin{figure}[!ht]\CenterFloatBoxes
\begin{floatrow}
\ffigbox[\FBwidth]
{\includegraphics[width=10cm,height=4cm]{example-image-a}}
{\caption{figure caption}\label{figure}}
\ttabbox[\FBwidth]
{\begin{tabular}{lll}
column1a & column2a & column3a \\
column1b & column2b & column3b \\
column1c & column2c & column3c \\
column1d & column2d & column3d
\end{tabular}}
{\caption{table}}
\end{floatrow}
\end{figure}
\lipsum[4]
\end{document}
The option [!ht]
was only used for the example; I am bot recommending its use.
To have the caption for the table below it (although it's usual for table captions to appear above the table), you can use \floatbox
instead of \ttabbox
for the table and perhaps do some additional adjustment for the vertical alignment using heightadjust
and valign
:
\documentclass{article}
\usepackage{graphicx}
\usepackage[rawfloats]{floatrow}
\usepackage{lipsum}
\DeclareMarginSet{hangboth}{\setfloatmargins*{\hskip-4cm}{\hskip-4cm}}
\begin{document}
\thisfloatsetup{floatwidth=\paperwidth,rowfill=yes,margins=hangboth,heightadjust=all,valign=b}
\lipsum[4]
\begin{figure}[!ht]
\begin{floatrow}
\ffigbox[\FBwidth]
{\includegraphics[width=10cm,height=4cm]{example-image-a}}
{\caption{figure caption}\label{figure}}
\floatbox{table}[\FBwidth]
{\caption{table}}
{\begin{tabular}{lll}
column1a & column2a & column3a \\
column1b & column2b & column3b \\
column1c & column2c & column3c \\
column1d & column2d & column3d
\end{tabular}}
\end{floatrow}
\end{figure}
\lipsum[4]
\end{document}