我怎样才能拥有具有相同行数的组织良好的数组,并在数组的每个部分组织下划线?
\documentclass{report}
\usepackage[francais]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{array,multirow,makecell}
\usepackage[table]{xcolor}
\usepackage{colortbl}
\newcolumntype{R}[1]{>{\raggedleft\arraybackslash }m{#1}}
\newcolumntype{L}[1]{>{\raggedright\arraybackslash }b{#1}}
\newcolumntype{C}[1]{>{\centering\arraybackslash }b{#1}}\renewcommand{\arraystretch}{1.2}
\definecolor{Gray}{gray}{0.9}
\begin{document}
\begin{table}[!h]
\begin{center}
\begin{tabular}{C{8.5cm}C{8.5cm}}
\begin{tabular}[t]{C{1.5cm}L{7cm}}
\multicolumn{1}{C{1.5cm}}{\cellcolor{Gray}A} &\multicolumn{1}{m{7cm}}{} \\
AIX & Advanced Interactive eXecutive\\
AMP & Access Module Processor\\\hline
\multicolumn{1}{C{1.5cm}}{\cellcolor{Gray}B} &\multicolumn{1}{m{7cm}}{} \\
BDDF & Banque De Détail en France\\\
BI & Business Intelligence\\
BNPP & Banque Nationale de Paris Paribas\\
BO & Business Objects \\
BPF & Banque Privée France\\
BTEQ & Batch \textbf{TE}radata Query\\ \hline
\multicolumn{1}{C{1.5cm}}{\cellcolor{Gray}C} &\multicolumn{1}{m{7cm}}{} \\
CBP & Centre de Banque Privée\\
CEO & Chief Executive Officer\\ \hline
\multicolumn{1}{C{1.5cm}}{\cellcolor{Gray}D} &\multicolumn{1}{m{7cm}}{} \\
DR & Direction Régionale\\
DTU & Dossier de Test Unitaires\\\hline
\multicolumn{1}{C{1.5cm}}{\cellcolor{Gray}E} &\multicolumn{1}{m{7cm}}{} \\
ENSA & Ecole Nationale des Sciences Appliquées\\
ETL & Extract Transform Load \\\hline
\multicolumn{1}{C{1.5cm}}{\cellcolor{Gray}F} &\multicolumn{1}{m{7cm}}{} \\
FDC & Fond De Commerce externe\\\hline
\multicolumn{1}{C{1.5cm}}{\cellcolor{Gray}G} &\multicolumn{1}{m{7cm}}{} \\
GL & Génie Logiciel\\\hline
\multicolumn{1}{C{1.5cm}}{\cellcolor{Gray}I} &\multicolumn{1}{m{7cm}}{} \\
IAC & Info centre Animation Commercial\\
IBM & International Business Machines\\
IBM AT & IBM Applications \& Technologies\\
\end{tabular}
&
\begin{tabular}[t]{C{1.5cm}L{7cm}}
\multicolumn{1}{C{1.5cm}}{} &\multicolumn{1}{m{6cm}}{}\\
IHM & Interface Hommes Machines\\
IPS & IT Production Services\\
IT & Information Technology\\\hline
\multicolumn{1}{C{1.5cm}}{\cellcolor{Gray}K} &\multicolumn{1}{m{7cm}}{} \\
KM & Knowledge Management\\
KSH & Korn shell\\\hline
\multicolumn{1}{C{1.5cm}}{\cellcolor{Gray}M} &\multicolumn{1}{m{6cm}}{} \\
MEP & la Mise En Pr oduction\\
MEQ & la Mise En Qualification\\
MOA & Maitrise d’OuvrAge\\
MOE & Maitrise d’Oeuvre \\
MPP & Massively Parallel Processing\\\hline
\multicolumn{1}{C{1.5cm}}{\cellcolor{Gray}O} &\multicolumn{1}{m{6cm}}{} \\
ODBC & Open DataBase Connectivity\\\hline
\multicolumn{1}{C{1.5cm}}{\cellcolor{Gray}P} &\multicolumn{1}{m{6cm}}{} \\ PE & Parsing Engine\\\hline
\multicolumn{1}{C{1.5cm}}{\cellcolor{Gray}S} &\multicolumn{1}{m{6cm}}{}\\ SGBDR & Système de Gestion de Bases de Données Relationnelles\\
SQL & Structured Query Language\\
SSH & Secure Shell\\\hline
\multicolumn{1}{C{1.5cm}}{\cellcolor{Gray}T} &\multicolumn{1}{m{6cm}}{} \\
TMA & Tierce Maintenance Applicative\\
TPT & Teradata Parallel Transporter\\\hline
\multicolumn{1}{C{1.5cm}}{\cellcolor{Gray}U} &\multicolumn{1}{m{6cm}}{} \\ UO & Unités Organisationnelles\\\hline
\multicolumn{1}{C{1.5cm}}{\cellcolor{Gray}W} &\multicolumn{1}{m{6cm}}{} \\WEBI & WEB Intelligence\\\hline
\end{tabular}
\end{tabular}
\end{center}
\end{table}
\end{document}
答案1
请尝试以下操作:
\documentclass{report}
%\usepackage{geometry} % for determine page layout
\usepackage[francais]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{array, multirow, makecell,
tabularx} % added
\usepackage[table]{xcolor}
\usepackage{colortbl}
\newcolumntype{R}[1]{>{\raggedleft\arraybackslash }m{#1}} % not used
\newcolumntype{L}[1]{>{\raggedright\arraybackslash }b{#1}} % not used
\newcolumntype{C}[1]{>{\centering\arraybackslash }b{#1}} % not used
\renewcommand{\arraystretch}{1.1} % changed from 1.2
\definecolor{Gray}{gray}{0.9}
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\begin{document}
\begin{table}[htb]
\centering
\setlength\tabcolsep{3pt}
\begin{tabular*}{\linewidth}{@{}
*{2}{p{\dimexpr0.5\linewidth-2\tabcolsep\relax}}
@{}}
\begin{tabularx}{\linewidth}[t]{c >{\raggedright\arraybackslash}X}
\cellcolor{Gray} A & \\
AIX & Advanced Interactive eXecutive \\
AMP & Access Module Processor \\ \hline
\cellcolor{Gray} B & \\
BDDF & Banque De Détail en France \\
BI & Business Intelligence \\
BNPP & Banque Nationale de Paris Paribas \\
BO & Business Objects \\
BPF & Banque Privée France \\
BTEQ & Batch \textbf{TE}radata Query \\ \hline
\cellcolor{Gray} C & \\
CBP & Centre de Banque Privée \\
CEO & Chief Executive Officer \\ \hline
\cellcolor{Gray} D & \\
DR & Direction Régionale \\
DTU & Dossier de Test Unitaires \\ \hline
\cellcolor{Gray} E & \\
ENSA & Ecole Nationale des Sciences Appliquées \\
ETL & Extract Transform Load \\ \hline
\cellcolor{Gray} F & \\
FDC & Fond De Commerce externe \\ \hline
\cellcolor{Gray} G & \\
GL & Génie Logiciel \\ \hline
\cellcolor{Gray} I & \\
IAC & Info centre Animation Commercial \\
IBM & International Business Machines \\
IBM AT & IBM Applications \& Technologies \\
\end{tabularx}
&
\begin{tabularx}{\linewidth}[t]{c >{\raggedright\arraybackslash}X}
& \\
IHM & Interface Hommes Machines\\
IPS & IT Production Services\\
IT & Information Technology \\ \hline
\cellcolor{Gray} K & \\
KM & Knowledge Management\\
KSH & Korn shell\\\hline
\cellcolor{Gray}M & \\
MEP & la Mise En Pr oduction\\
MEQ & la Mise En Qualification\\
MOA & Maitrise d’OuvrAge\\
MOE & Maitrise d’Oeuvre \\
MPP & Massively Parallel Processing\\\hline
\cellcolor{Gray} O & \\
ODBC & Open DataBase Connectivity\\\hline
\cellcolor{Gray} P & \\
PE & Parsing Engine\\\hline
\cellcolor{Gray} S & \\
SGBDR & Système de Gestion de Bases de Données Relationnelles\\
SQL & Structured Query Language\\
SSH & Secure Shell\\\hline
\cellcolor{Gray} T & \\
TMA & Tierce Maintenance Applicative\\
TPT & Teradata Parallel Transporter\\\hline
\cellcolor{Gray} U & \\
UO & Unités Organisationnelles\\\hline
\cellcolor{Gray} W & \\
WEBI & WEB Intelligence \\ \hline
\end{tabularx}
\end{tabular*}
\end{table}
\end{document}
\documentclass{report}
\usepackage{geometry}
%\usepackage[francais]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{array, multirow, makecell,
tabularx} % added
\usepackage[table]{xcolor}
\usepackage{colortbl}
\newcolumntype{R}[1]{>{\raggedleft\arraybackslash }m{#1}} % not used
\newcolumntype{L}[1]{>{\raggedright\arraybackslash }b{#1}} % not used
\newcolumntype{C}[1]{>{\centering\arraybackslash }b{#1}} % not used
\renewcommand{\arraystretch}{1.1} % changed from 1.2
\definecolor{Gray}{gray}{0.9}
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\begin{document}
\begin{table}[htb]
\centering
\setlength\tabcolsep{3pt}
\begin{tabular*}{\linewidth}{@{}
*{2}{p{\dimexpr0.5\linewidth-2\tabcolsep\relax}}
@{}}
\begin{tabularx}{\linewidth}[t]{c >{\raggedright\arraybackslash}X}
\cellcolor{Gray} A & \\
AIX & Advanced Interactive eXecutive \\
AMP & Access Module Processor \\ \hline
\cellcolor{Gray} B & \\
BDDF & Banque De Détail en France \\
BI & Business Intelligence \\
BNPP & Banque Nationale de Paris Paribas \\
BO & Business Objects \\
BPF & Banque Privée France \\
BTEQ & Batch \textbf{TE}radata Query \\ \hline
\cellcolor{Gray} C & \\
CBP & Centre de Banque Privée \\
CEO & Chief Executive Officer \\ \hline
\cellcolor{Gray} D & \\
DR & Direction Régionale \\
DTU & Dossier de Test Unitaires \\ \hline
\cellcolor{Gray} E & \\
ENSA & Ecole Nationale des Sciences Appliquées \\
ETL & Extract Transform Load \\ \hline
\cellcolor{Gray} F & \\
FDC & Fond De Commerce externe \\ \hline
\cellcolor{Gray} G & \\
GL & Génie Logiciel \\ \hline
\cellcolor{Gray} I & \\
IAC & Info centre Animation Commercial \\
IBM & International Business Machines \\
IBM AT & IBM Applications \& Technologies \\
\end{tabularx}
&
\begin{tabularx}{\linewidth}[t]{c >{\raggedright\arraybackslash}X}
& \\
IHM & Interface Hommes Machines\\
IPS & IT Production Services\\
IT & Information Technology \\ \hline
\cellcolor{Gray} K & \\
KM & Knowledge Management\\
KSH & Korn shell\\\hline
\cellcolor{Gray}M & \\
MEP & la Mise En Pr oduction\\
MEQ & la Mise En Qualification\\
MOA & Maitrise d’OuvrAge\\
MOE & Maitrise d’Oeuvre \\
MPP & Massively Parallel Processing\\\hline
\cellcolor{Gray} O & \\
ODBC & Open DataBase Connectivity\\\hline
\cellcolor{Gray} P & \\
PE & Parsing Engine\\\hline
\cellcolor{Gray} S & \\
SGBDR & Système de Gestion de Bases de Données Relationnelles\\
SQL & Structured Query Language\\
SSH & Secure Shell\\\hline
\cellcolor{Gray} T & \\
TMA & Tierce Maintenance Applicative\\
TPT & Teradata Parallel Transporter\\\hline
\cellcolor{Gray} U & \\
UO & Unités Organisationnelles\\\hline
\cellcolor{Gray} W & \\
WEBI & WEB Intelligence \\ \hline
\end{tabularx}
\end{tabular*}
\end{table}
\end{document}
如果您取消注释行,您将获得更好的结果\usepackage{geometry}
。在这种情况下,表格将如下所示: