表Latex: 線を追加してキャプションを中央に配置する

表Latex: 線を追加してキャプションを中央に配置する

私はLaTeXの初心者です。テーブルを描きたいのですが、

ここに画像の説明を入力してください

行間に線を追加し、中央にキャプションを追加して、セルを拡張したいと思います。

\documentclass{article}
\usepackage{multirow}
\usepackage{array}
\begin{document}
    \begin{table}
      \centering  
      \begin{tabular}{|>{\bfseries}c|*{4}{c|}}\hline
        \multirow{2}{*}{\bfseries Algorithme} &
        \multicolumn{2}{c|}{\bfseries 2-hop} \\\cline{2-5} & \textbf{node}       & \textbf{true?} \\ \hline
        R-ELM         & Normal              & No             \\ \hline
        Q-ELM         & Normal              & No             \\ \hline
      \end{tabular}
      \caption{some table}
      \end{table}
\end{document}

答え1

ここに画像の説明を入力してください

\documentclass{article} 
\usepackage{array, multirow} 

\begin{document} 
    \begin{table}
    \setlength\tabcolsep{18pt}% default value is 6pt 
    \centering 
\begin{tabular}{|>{\bfseries}c| *{2}{c|} } 
    \hline 
\multirow{2}{*}{Algorithme} & \multicolumn{2}{c|}{\textbf{2-hop}}   \\ 
    \cline{2-3}                          
                            & \textbf{node} & \textbf{true?}        \\ 
    \hline
        R-ELM               & Normal    & No                        \\ 
    \hline Q-ELM            & Normal    & No                        \\ 
    \hline 
\end{tabular} 
    \caption{some table} 
    \end{table} 
\end{document}

関連情報