Comment organiser les sous-tableaux?

Sep 07 2020

J'ai créé trois sous-tableaux et je les placerais dans la page comme dans l'image suivante:

Pouvez-vous m'aider ?

De plus, je ne peux pas utiliser le bon package. J'utilise \ usepackage {subcaption} mais cela ne semble pas fonctionner! Voici mon code:

\begin{table}

%Subtable 1
\begin{subtable}[b]{0.48\textwidth}
\begin{tabular}{|c|c|}

\hline
\multicolumn{2}{|c|}{\cellcolor[HTML]{F54A19}{\color[HTML]{FFFFFF} \textbf{GENERAL}}}    \\ \hline
\textbf{Mass}  & \cellcolor[HTML]{FDDCD3}207 grams                                       \\ \hline
               & \begin{tabular}[c]{@{}c@{}}67 x 69 x 34 mm\\ (electronics)\end{tabular} \\ \cline{2-2} 
\multirow{-2}{*}{\textbf{Dimensions}} & \cellcolor[HTML]{FDDCD3}\begin{tabular}[c]{@{}c@{}}41 x 51 x   15 mm\\ (detector head)\end{tabular} \\ \hline
\textbf{Power} & 2.15 Watts                                                              \\ \hline
\end{tabular}
\end{subtable}

\hspace{\fill}


%Subtable 2
\begin{subtable}[t]
\flushright
\begin{tabular}{|c|c|}
\hline
\rowcolor[HTML]{F54A19} 
\multicolumn{2}{|c|}{\cellcolor[HTML]{F54A19}{\color[HTML]{FFFFFF} \textbf{DETECTOR}}}                           \\ \hline
\rowcolor[HTML]{FDDCD3} 
\textbf{CCD full well}                                                                 & 170000 electrons        \\ \hline
\textbf{\begin{tabular}[c]{@{}c@{}}CCD readout noise, \\ 55 °C\end{tabular}} & \textless { 37} electrons  \\ \hline
\rowcolor[HTML]{FDDCD3} 
\textbf{CCD Gain, 55 °C}                                                               & 98   electrons/DN       \\ \hline
\textbf{\begin{tabular}[c]{@{}c@{}}ADC digitization \\ 12 bits/pixel\end{tabular}} & 12 bits/pixel                                                              \\ \hline
\rowcolor[HTML]{FDDCD3} 
\textbf{Frame transfer time}                                                           & 5.12 ms                 \\ \hline
\textbf{\begin{tabular}[c]{@{}c@{}}CCD readout time,\\ full-frame mode\end{tabular}}   & 5.4   s                 \\ \hline
\rowcolor[HTML]{FDDCD3} 
\textbf{\begin{tabular}[c]{@{}c@{}}CCD readout time,\\ 4 x 1 binned mode\end{tabular}} & 1.4 s                   \\ \hline
\textbf{Pixel  size}                                                                   & 12 x12 microns          \\ \hline
\rowcolor[HTML]{FDDCD3} 
\textbf{Fill factor}                                                                   & 100\%                   \\ \hline
\textbf{SNR}                                                                           & \textgreater{ 200:1 }    \\ \hline
\rowcolor[HTML]{FDDCD3} 
\textbf{Exposure time}                                                             & \begin{tabular}[c]{@{}c@{}}0 –335.5 s, \\ in steps of 5.12 ms\end{tabular} \\ \hline
\end{tabular}
\end{subtable}

\hspace{\fill}


%Subtable 3
\begin{subtable}[]
\flushright
\begin{tabular}{|c|c|}
\hline
\rowcolor[HTML]{F54A19} 
\multicolumn{2}{|c|}{\cellcolor[HTML]{F54A19}{\color[HTML]{FFFFFF} OPTICAL}}                                                     \\ \hline
\rowcolor[HTML]{FDDCD3} 
\textbf{\begin{tabular}[c]{@{}c@{}}Angular resolution \\ at the center of \\ Field Of View (FOV)\end{tabular}} & 0.82 mrad/pixel \\ \hline
\rowcolor[HTML]{FFFFFF} 
\textbf{Focal Length}            & 14.67 mm         \\ \hline
\rowcolor[HTML]{FDDCD3} 
\textbf{f/number}                & 12               \\ \hline
\rowcolor[HTML]{FFFFFF} 
\textbf{Entrance pupil diameter} & 1.25 mm          \\ \hline
\rowcolor[HTML]{FDDCD3} 
\textbf{FOV}                     & 45° x 45°        \\ \hline
\rowcolor[HTML]{FFFFFF} 
\textbf{Diagonal FOV}            & 67°              \\ \hline
\rowcolor[HTML]{FDDCD3} 
\textbf{Depth of field}          & 0.5 m – infinity \\ \hline
\rowcolor[HTML]{FFFFFF} 
\textbf{Best focus}              & 1.0 m            \\ \hline
\rowcolor[HTML]{FDDCD3} 
\textbf{Spectral range}          & 400 – 1100 nm    \\ \hline
\rowcolor[HTML]{FFFFFF} 
\textbf{\begin{tabular}[c]{@{}c@{}}Height above Martian \\ surface\end{tabular}}                               & $\sim$1500 m    \\ \hline
\end{tabular}
\end{subtable}

\caption{MER Descent camera technical data}
    % \label{tab:temps}
\end{table} 

Réponses

1 Zarko Sep 07 2020 at 18:56

Au lieu de cela, ils subtablessont utilisés tabularximbriqués dans table*. Pour la coloration des lignes est utilisé \rowcolors{1}{white}{red!30}défini dans le xtabularpackage:

\documentclass{article}
\usepackage{geometry}
\usepackage[table]{xcolor}
\usepackage{multirow, tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\usepackage{siunitx}

\begin{document}
    \begin{table}
    \sisetup{product-units=single}
    \renewcommand\tabularxcolumn[1]{m{#1}}
    \renewcommand\arraystretch{1.2}
\begin{tabular*}{\textwidth}{|*{2}{p{\dimexpr0.5\linewidth-2\tabcolsep-\arrayrulewidth}|}}
\hline
%Subtable 1
\rowcolors{1}{white}{red!10}
\begin{tabularx}{\linewidth}[t]{|>{\bfseries\hsize=0.9\hsize}C|
                              >{\hsize=1.1\hsize}C|}
    \hline
    \rowcolor[HTML]{F54A19}
\multicolumn{2}{|c|}{\textcolor{white}{\textbf{GENERAL}}}    \\ 
    \hline
Mass        &   207 grams                                   \\ 
    \hline
Dimensions  &   \SI{67 x 69 x 34}{mm}\newline
                (electronics)\newline 
                \SI{41 x 51 x 15}{mm}\newline
                (detector head)                             \\ 
    \hline
Power       & 2.15 Watts                                    \\
    \hline
    \end{tabularx}

\medskip
%Subtable 2
\rowcolors{1}{white}{red!10}
    \begin{tabularx}{\linewidth}{|>{\bfseries}C|C|}
    \hline
    \rowcolor[HTML]{F54A19}
\multicolumn{2}{|c|}{\textcolor{white}{\textbf{DETECTOR}}}  \\ 
    \hline
%    \rowcolor[HTML]{FDDCD3}
CCD full well       & 170000 electrons                      \\ 
    \hline
CCD readout noise,
\SI{55}{\celsius}   & \textless 3  electrons                \\ 
    \hline
%    \rowcolor[HTML]{FDDCD3}
CCD Gain, \SI{55}{\celsius}
                    & 98   electrons/DN                     \\ 
    \hline
ADC digitization  
12 bits/pixel       & 12 bits/pixel                         \\ 
    \hline
Frame transfer time & \SI{5.12}{ms}                         \\ 
    \hline
CCD readout time, 
full-frame mode     & \SI{5.4}{s}                           \\ 
    \hline
CCD readout time,
$4\times 1$ binned  & \SI{1.4}{s}                           \\ 
    \hline
Pixel  size         & \SI{12 x 12}{\micro\meter}            \\ 
    \hline
Fill factor         & \SI{100}{\%}                          \\ 
    \hline
SNR                 & \textgreater 200:1                    \\ 
    \hline
Exposure time       & $-\SI{335.5}{s}$, 
                      in steps of \SI{5.12}{ms}             \\ 
    \hline
    \end{tabularx} 
\smallskip 
    &
%Subtable 3
\rowcolors{1}{white}{red!10}
    \begin{tabularx}{\linewidth}[t]{|>{\bfseries\hsize=1.2\hsize}C|
                                     >{\hsize=0.8\hsize}C|}
    \hline
    \rowcolor[HTML]{F54A19}
\multicolumn{2}{|c|}{\textcolor{white}{OPTICAL}}    \\
    \hline
\rowcolor[HTML]{FDDCD3}
Angular resolution
at the center of
Field Of View (FOV) & \SI{0.82}{mrad/pixel}   \\
    \hline
Focal Length        & \SI{14.67}{mm}                \\
    \hline
f/number            & 12                            \\
    \hline
Entrance pupil diameter
                    & \SI{1.25}{mm}                 \\
    \hline
FOV                 & \SI[product-units=repeat]{45 x 45}{\degree} \\
    \hline
Diagonal FOV        & \SI{67}{\degree}              \\
    \hline
Depth of field      & \SI{0.5}{m} – infinity        \\
    \hline
Best focus          & \SI{1.0}{m}                   \\
    \hline
Spectral range      & \SI{400}{1100}{nm}            \\
    \hline
Height above
Martian surface     & $\sim$\SI{1500}{m}            \\
    \hline
    \end{tabularx} \\
\hline
\end{tabular*}  

\caption{MER Descent camera technical data}
    % \label{tab:temps}
\end{table} 
\end{document}
2 egreg Sep 07 2020 at 17:39

Quelques astuces.

Un ensemble de deux colonnes tabularpour obtenir la ligne centrale. Chaque colonne a un tableau pour empiler les deux tables intérieures sur la gauche et aussi la seule sur la droite, avec une astuce pour l'alignement du haut.

Le tout dans une zone de largeur nulle, car il dépasse la taille du texte. Cela peut ne pas être nécessaire dans votre cas, selon vos paramètres.

\documentclass[a4paper]{article}
\usepackage[table]{xcolor}
\usepackage{multirow}

\begin{document}

\begin{table}
\centering

\makebox[0pt]{%
\begin{tabular}{@{}c|c@{}} % for the center line

\begin{tabular}[t]{@{}c@{}}
\\[-\normalbaselineskip]

\begin{tabular}[b]{|c|c|}
\hline
\multicolumn{2}{|c|}{\cellcolor[HTML]{F54A19}{\color[HTML]{FFFFFF} \textbf{GENERAL}}}    \\ \hline
\textbf{Mass}  & \cellcolor[HTML]{FDDCD3}207 grams                                       \\ \hline
\multirow{3}{*}{\textbf{Dimensions}} & \begin{tabular}[c]{@{}c@{}}67 x 69 x 34 mm\\ (electronics)\end{tabular} \\ \cline{2-2} 
 & \cellcolor[HTML]{FDDCD3}\begin{tabular}[c]{@{}c@{}}41 x 51 x   15 mm\\ (detector head)\end{tabular} \\ \hline
\textbf{Power} & 2.15 Watts                                                              \\ \hline
\end{tabular}

\\[2ex]

\begin{tabular}[t]{|c|c|}
\hline
\rowcolor[HTML]{F54A19} 
\multicolumn{2}{|c|}{\cellcolor[HTML]{F54A19}{\color[HTML]{FFFFFF} \textbf{DETECTOR}}}                           \\ \hline
\rowcolor[HTML]{FDDCD3} 
\textbf{CCD full well}                                                                 & 170000 electrons        \\ \hline
\textbf{\begin{tabular}[c]{@{}c@{}}CCD readout noise, \\ 55 °C\end{tabular}} & \textless { 37} electrons  \\ \hline
\rowcolor[HTML]{FDDCD3} 
\textbf{CCD Gain, 55 °C}                                                               & 98   electrons/DN       \\ \hline
\textbf{\begin{tabular}[c]{@{}c@{}}ADC digitization \\ 12 bits/pixel\end{tabular}} & 12 bits/pixel                                                              \\ \hline
\rowcolor[HTML]{FDDCD3} 
\textbf{Frame transfer time}                                                           & 5.12 ms                 \\ \hline
\textbf{\begin{tabular}[c]{@{}c@{}}CCD readout time,\\ full-frame mode\end{tabular}}   & 5.4   s                 \\ \hline
\rowcolor[HTML]{FDDCD3} 
\textbf{\begin{tabular}[c]{@{}c@{}}CCD readout time,\\ 4 x 1 binned mode\end{tabular}} & 1.4 s                   \\ \hline
\textbf{Pixel  size}                                                                   & 12 x12 microns          \\ \hline
\rowcolor[HTML]{FDDCD3} 
\textbf{Fill factor}                                                                   & 100\%                   \\ \hline
\textbf{SNR}                                                                           & \textgreater{ 200:1 }    \\ \hline
\rowcolor[HTML]{FDDCD3} 
\textbf{Exposure time}                                                             & \begin{tabular}[c]{@{}c@{}}0 –335.5 s, \\ in steps of 5.12 ms\end{tabular} \\ \hline
\end{tabular}

\end{tabular}
&
\begin{tabular}[t]{@{}c@{}}
\\[-\normalbaselineskip]

\begin{tabular}{|c|c|}
\hline
\rowcolor[HTML]{F54A19} 
\multicolumn{2}{|c|}{\cellcolor[HTML]{F54A19}{\color[HTML]{FFFFFF} OPTICAL}}                                                     \\ \hline
\rowcolor[HTML]{FDDCD3} 
\textbf{\begin{tabular}[c]{@{}c@{}}Angular resolution \\ at the center of \\ Field Of View (FOV)\end{tabular}} & 0.82 mrad/pixel \\ \hline
\rowcolor[HTML]{FFFFFF} 
\textbf{Focal Length}            & 14.67 mm         \\ \hline
\rowcolor[HTML]{FDDCD3} 
\textbf{f/number}                & 12               \\ \hline
\rowcolor[HTML]{FFFFFF} 
\textbf{Entrance pupil diameter} & 1.25 mm          \\ \hline
\rowcolor[HTML]{FDDCD3} 
\textbf{FOV}                     & 45° x 45°        \\ \hline
\rowcolor[HTML]{FFFFFF} 
\textbf{Diagonal FOV}            & 67°              \\ \hline
\rowcolor[HTML]{FDDCD3} 
\textbf{Depth of field}          & 0.5 m – infinity \\ \hline
\rowcolor[HTML]{FFFFFF} 
\textbf{Best focus}              & 1.0 m            \\ \hline
\rowcolor[HTML]{FDDCD3} 
\textbf{Spectral range}          & 400 – 1100 nm    \\ \hline
\rowcolor[HTML]{FFFFFF} 
\textbf{\begin{tabular}[c]{@{}c@{}}Height above Martian \\ surface\end{tabular}}                               & $\sim$1500 m    \\ \hline
\end{tabular}

\end{tabular}
\end{tabular}}

\caption{MER Descent camera technical data}
    % \label{tab:temps}
\end{table}

\end{document}