如何減小表格中儲存格的大小?

如何減小表格中儲存格的大小?

我正在繪製一張只有一列的長桌。我已經繪製了表格,但單元格尺寸太大。如何縮小單元格尺寸?我想讓該行在下一頁的右上角而不是左角繼續。我該怎麼做。我的程式碼如下。我已附上錯誤的圖像。 在此輸入影像描述

\begingroup
    \setcellgapes{3pt}
    \makegapedcells
 \begin{xltabular}{\linewidth}{ |l||*{1}{>{\hskip 1em}X|} }
%\begin{xltabular}{ |p{3 cm}||p{3.8cm}| }
\caption{Simulation data of overall system}
\label{tab:overalldata}\\
    \Xhline{1pt}
\makecell[t]{System parameters}
    &   \mcx{Simulation data}\\
    \Xhline{0.6pt}
\endfirsthead
%\caption[]{Data comparison of steady state and transient simulation}    \\
    \Xhline{1pt}
\makecell{System parameters}
    &   \mcx{Simulation data}\\
    \Xhline{0.6pt}
\endhead
    \Xhline{0.6pt}
\multicolumn{4}{r}{\small\textit{Continue on the next page}}
\endfoot
    \Xhline{1pt}
\endlastfoot
Pel\_Boiler (\si{KW})    &92.572\\ 
N\_STEAM\_RECY (\si{mol/s}) &1.686\\
Pel\_SH (\si{KW})   &66.869 \\ 
T\_AC\_OUT (\si{K}) &945.732\\
T\_CC\_OUT (\si{K}) &885.8513695\\
\hline
\end{xltabular}
\endgroup

答案1

我猜你正在尋找這樣的東西:

在此輸入影像描述

上表中是使用的longtablesiunitx封裝。xparse用於定義新指令,而不是使用\multicolumn{...}{...}{<content>}.顯示的結果需要(至少)對以下 MWE 進行四次編譯:

\documentclass{article}
\usepackage[skip=1ex]{caption}
\usepackage{cellspace, longtable}
    \setlength\cellspacetoplimit{3pt}
    \setlength\cellspacebottomlimit{3pt}
\usepackage{siunitx}
\sisetup{per-mode=symbol}
\usepackage{xparse}
\NewExpandableDocumentCommand\mcc{O{|Cc|}m}
    {\multicolumn{2}{#1}{#2}}
\NewExpandableDocumentCommand\mcl{O{c}m}
    {\multicolumn{1}{#1}{#2}}

\begin{document}            
    \begin{longtable}{| Cr s[table-unit-alignment = left] 
                      |    S[zero-decimal-to-integer,
                             round-mode=places,
                             round-precision=3]
                      |}
\caption{Simulation data of overall system.}
\label{tab:s:align}                                     \\
    \hline
\mcc{System parameters}             & {value}           \\
    \hline
\endfirsthead
\caption[]{Simulation data of overall system.}    \\
    \hline
\mcc{System parameters}             & {value}           \\
    \hline
\endhead
    \hline
\mcl{}          & \mcc[r]{\footnotesize{Continue on the next page}}
\endfoot
    \hline
\endlastfoot
% table body
Pel\_Boiler     & \kilo\watt        &   92.572      \\
N\_STEAM\_RECY  & \mol\per\second   &    1.686      \\
Pel\_SH         & \kilo\watt        &   66.869      \\
T\_AC\_OUT      & \kelvin           &  945.732      \\
T\_CC\_OUT      & \kelvin           &  885.8513695  \\
    \end{longtable}
\end{document}

編輯:

由於格式makegapedcells中定義的巨集與aditem MWE 中的列之間不相容,因此該套件被替換為在儲存格中新增垂直空間。makecellsSmakecellcellspace

現在也向列新增了舍入選項S

相關內容