如何将表格标题拆分为两行

如何将表格标题拆分为两行

我有一张带有长标题文本的表格

在此处输入图片描述

我尝试将标题拆分为两行,但当我添加 \ 时,Tex 中出现错误

这是我的文本

\begin{table*}[htbp]
    \caption{AutoML platforms used in the healthcare research}
    \begin{center}
        \begin{tabular}{|c|c|c|c|c|c|c|c|}
            \hline
            \textbf{\textit{Research}} & \textbf{{Commercial AutoML (Google AutoML and Apple Create ML)}}&  \textbf{\textit{T1}}& \textbf{\textit{T2}}& \textbf{\textit{T3}}
            & \textbf{\textit{T4}}& \textbf{\textit{T5}}
            & \textbf{\textit{T6}}\\
            \hline
            [36]&.&.&.&.&.&.&X\\
            \hline          
            [37]&.&.&.&.&.&.&X\\
            \hline

            
        \end{tabular}
        \label{graph_i}
    \end{center}
\end{table*}

有没有办法将标题分成两行?

谢谢

答案1

   \textbf{\textit{Research}} & \textbf{\thead{Commercial AutoML \\(Google AutoML and Apple Create ML)}}&  \textbf{\textit{T1}}& \textbf{\textit{T2}}& \textbf{\textit{T3}}

在此处输入图片描述

\documentclass[demo]{article}
\usepackage{nicematrix}
\usepackage{tikz}
\usepackage{calc}
\usepackage{booktabs}
\usepackage{xcolor,colortbl}
\usepackage{graphicx}

\usepackage{makecell}
\begin{document}
\begin{tabular}{|c|c|c|c|c|c|c|c|}
    \hline
    \textbf{\textit{Research}} & \textbf{\thead{Commercial AutoML \\(Google AutoML and Apple Create ML)}}&  \textbf{\textit{T1}}& \textbf{\textit{T2}}& \textbf{\textit{T3}}
    & \textbf{\textit{T4}}& \textbf{\textit{T5}}
    & \textbf{\textit{T6}}\\
    \hline
    [36]&.&.&.&.&.&.&X\\
    \hline          
    [37]&.&.&.&.&.&.&X\\
    \hline
    
    
\end{tabular}
\end{table}
\end{document}

相关内容