怎么画简单的表格

怎么画简单的表格

我想根据@Zarko 的答案创建下表,因为我对另一种表使用了相同的代码在此处输入链接描述

https://tex.stackexchange.com/questions/427064/itemize-inside-itemize-and-some-of-borders-around-the-gray-title-section-are-mis

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[table]{xcolor}
\usepackage{tabularx}
\usepackage{enumitem}
\usepackage{etoolbox}
\AtBeginEnvironment{center}{%
    \setlist[itemize,1]{nosep,
                        topsep     = 0pt,
                        partopsep  = 0pt,
                        leftmargin = *,
                        label      = \textendash,
                        before     = \vspace{-0.6\baselineskip},
                        after      = \vspace{-\baselineskip}
                        }
    \setlist[itemize]{  nosep,
                        leftmargin=*,
                        label = $\bullet$
                      } }

\begin{document}
    \begin{center}
\bfseries
\begin{tabularx}{\linewidth}{ | l | X |X| }
    \hline
\multicolumn{2}{|>{\centering\arraybackslash}%
                 p{\dimexpr\linewidth-2\tabcolsep-2\arrayrulewidth\relax}|}{\cellcolor{gray!30}
    Very long text here and centered
    Very long text here and centered
    Very long text here and centered}    \\
    \hline
\multicolumn{3}{c}{}                    \\
    \hline
Year &   Cycle & Issues     \\
    \hline
2018-2019   & High School & very \\
    \hline
\end{tabularx}
    \end{center}
\end{document}

答案1

在此处输入图片描述

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[table]{xcolor}
\usepackage{makecell, multirow, rotating, tabularx}

\begin{document}
    \begin{center}
\bfseries
\settowidth\rotheadsize{High School}
\begin{tabularx}{\linewidth}{|c|c|>{\centering\arraybackslash}X|}
    \hline
\multicolumn{3}{|>{\centering\arraybackslash}%
                 p{\dimexpr\linewidth-2\tabcolsep-2\arrayrulewidth\relax}|}{\cellcolor{gray!30}
    Issues}    \\
    \hline
Year &   Cycle & Issues     \\
    \hline
\multirow[b]{3}{*}{\rothead{2018-2019}}   
    & \multirowcell{1}{\rothead{High School}} 
        & long text centered here   \rule[-1em]{0pt}{2.5em} \\
    \cline{3-3}
    &   & long text centered here   \rule[-1em]{0pt}{2.5em} \\
    \cline{3-3}
    &   & long text centered here   \rule[-1em]{0pt}{2.5em} \\
    \hline
\end{tabularx}
    \end{center}
\end{document}

相关内容