机械营销型网站,贸易有限公司,订单网站怎么做,购物软件在LaTeX表格中#xff0c;如何使用\multirow合并单元格#xff0c;并将单元格中的文字旋转九十度#xff0c;并且居中呢#xff1f;
首先引入graphicx、multirow和array包#xff1a;
\usepackage{graphicx}
\usepackage{multirow}
\usepackage{booktabs}然后定义一种新…在LaTeX表格中如何使用\multirow合并单元格并将单元格中的文字旋转九十度并且居中呢
首先引入graphicx、multirow和array包
\usepackage{graphicx}
\usepackage{multirow}
\usepackage{booktabs}然后定义一种新的表格列样式
\newcolumntype{M}[1]{{\centering\arraybackslash}m{#1}}然后使用如下代码定义单元格
\multirow{6}{*}{\rotatebox[originc]{90}{iPhone}}如果想让文字旋转不同角度修改90为其他值即可。
例子 完整代码
\documentclass{article}
\usepackage{graphicx}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage{array}\title{Happy New Chinese Year! 2024!}
\author{Xovee Xu}
\date{February 2024}\begin{document}\maketitle% \section{Introduction}\begin{table}[h]\centering\newcolumntype{M}[1]{{\centering\arraybackslash}m{#1}}\begin{tabular}{M{1cm}ll}\toprule\textbf{Type} \textbf{Model} \textbf{Year} \\ \midrule\multirow{6}{*}{\rotatebox[originc]{90}{iPhone}} iPhone 15 2023 \\ iPhone 14 2022 \\ iPhone 13 2021 \\ iPhone 12 2020 \\ iPhone 11 2019 \\ $\dots$ $\dots$ \\ \midrule\multirow{9}{*}{\rotatebox[originc]{90}{iPad}} iPad 10 2022 \\ iPad Pro 6th 2022 \\ iPad Air 5th 2022 \\ iPad Mini 6th 2021 \\ iPad 9th 2021 \\ iPad Pro 5th 2021 \\ iPad Air 4th 2020 \\ iPad 8th 2020 \\ $\dots$ $\dots$ \\ \bottomrule\end{tabular}\caption{Major Apple iPhone and iPad Models}\label{tab:apple-product}
\end{table}\end{document}