\documentclass[12pt]{article}
\usepackage[
a4paper,
margin = 5mm,
landscape,
%showframe,
]
{geometry}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{multirow}
\renewcommand{\aboverulesep}{0pt}
\renewcommand{\belowrulesep}{0pt}
\usepackage[table]{xcolor} % loads also colortbl
\definecolor{myTableColor}{gray}{0.80}
\usepackage[sfdefault]{cabin}
\begin{document}
\noindent
\setlength{\arrayrulewidth}{1pt}
\begin{tabularx}{\textwidth}{lc|l|X|X|X|X}
\toprule
\rowcolor{myTableColor}
\multicolumn{2}{l}{\textbf{Text}} & Text & Text & Text & Text & Text\\
\midrule
Text & \cellcolor{myTableColor} & & & & & \\
%\cmidrule{3-7}
\cline{3-7}
Text & \cellcolor{myTableColor}\multirow{-2}{*}{A} & & & & & \\
\midrule
\multicolumn{2}{l|}{Text} & & & & & \\
\midrule
Text & \cellcolor{myTableColor} & & & & & \\
\cmidrule{3-7}
%\cline{3-7}
Text & \cellcolor{myTableColor}\multirow{-2}{*}{A} & & & & & \\
\bottomrule
\end{tabularx}
% \multirow{-2}{*}{A} is taken from user Gonzalo Medina
% https://tex.stackexchange.com/questions/21155
\end{document}
- 나는
multirow
과 을 가지고 있습니다cellcolor
. \cmidrule
에서 사용하고 싶습니다booktabs
.- 라인이 이상해집니다.
\cline
잘 작동합니다.- 나도 시도했다
\cmidrule[0pt]
. \cmidrule
그리고 와 의 선폭도\midrule
다른 것 같습니다.
답변1
makecell
이 코드는 다음 과 같이 원하는 작업을 수행합니다 \Xcline{3-7}{0.05em}
. 값은 ( ) 0.05em
의 기본 두께입니다 . 에 관해서는 기본값은 입니다 .\midrule
\lightrulewidth
\cmidrule
0.03em
\documentclass[12pt]{article}
\usepackage[
a4paper,
margin = 5mm,
landscape,
%showframe,
]
{geometry}
\usepackage{tabularx}
\usepackage{booktabs, makecell}
\usepackage{multirow}
\renewcommand{\aboverulesep}{0pt}
\renewcommand{\belowrulesep}{0pt}
\usepackage[table]{xcolor} % loads also colortbl
\definecolor{myTableColor}{gray}{0.80}
\usepackage[sfdefault]{cabin}
\begin{document}
\noindent
\setlength{\arrayrulewidth}{1pt}
\begin{tabularx}{\textwidth}{lc|l|X|X|X|X}
\toprule
\rowcolor{myTableColor}
\multicolumn{2}{l}{\textbf{Text}} & Text & Text & Text & Text & Text\\
\midrule
Text & \cellcolor{myTableColor} & & & & & \\
\Xcline{3-7}{0.05em}
Text & \cellcolor{myTableColor}\multirow{-2}{*}{A} & & & & & \\
\midrule
\multicolumn{2}{l|}{Text} & & & & & \\
\midrule
Text & \cellcolor{myTableColor} & & & & & \\
\Xcline{3-7}{0.05em}
Text & \cellcolor{myTableColor}\multirow{-2}{*}{A} & & & & & \\
\bottomrule
\end{tabularx}
% \multirow{-2}{*}{A} is taken from user Gonzalo Medina
% https://tex.stackexchange.com/questions/21155
\end{document}
답변2
{NiceTabular}
of 를 사용하면 예상되는 출력과 함께 및 of 를 nicematrix
직접 사용할 수 있습니다 .\midrule
\cmidrule
booktabs
\documentclass[12pt]{article}
\usepackage{xcolor}
\usepackage[a4paper,margin = 5mm,landscape]{geometry}
\usepackage{booktabs}
\renewcommand{\aboverulesep}{0pt}
\renewcommand{\belowrulesep}{0pt}
\usepackage{nicematrix}
\definecolor{myTableColor}{gray}{0.80}
\usepackage[sfdefault]{cabin}
\begin{document}
\noindent
\setlength{\arrayrulewidth}{1pt}
\begin{NiceTabularX}{\textwidth}{lc|l|X|X|X|X}
\toprule
\RowStyle[rowcolor=myTableColor]{}
\Block[l]{1-2}{\textbf{Text}} & Text & Text & Text & Text & Text \\
\midrule
Text & \Block[fill=myTableColor]{2-1}{A} & & & & & \\
\cmidrule{3-7}
Text \\
\midrule
Text \\
\midrule
Text & \Block[fill=myTableColor]{2-1}{A} & & & & & \\
\cmidrule{3-7}
Text \\
\bottomrule
\end{NiceTabularX}
\end{document}
여러 컴파일이 필요합니다( nicematrix
내부적으로 PGF/Tikz 노드를 사용하기 때문에).