\documentclass[a4paper,11pt,twoside,openright]{book}
% \usepackage{geometry}
% \geometry{
% a4paper,
% total={210mm,297mm},
% left=20mm,
% right=20mm,
% top=20mm,
% bottom=20mm,
% }
\usepackage[margin=1in]{geometry}
\usepackage[utf8x]{inputenc}
\usepackage[italian]{babel}
\usepackage[T1]{fontenc}
\usepackage{fancyhdr}
\usepackage{showkeys}
% \usepackage[dvips]{graphicx}
% per le figure:
\usepackage{graphicx}
% per il testo attorno alle figure
\usepackage{floatflt,epsfig}
\usepackage{wrapfig}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{array}
% usare colori in tabella:
\usepackage{xcolor,colortbl}
\usepackage{titlesec}
%tabelle lunghe (gestione oltre il margine)
\usepackage{longtable}
\usepackage{ltablex}
% \usepackage{lmode rn}
% \usepackage{listings}
% \usepackage[usenames]{color}
% \usepackage{color}
% \usepackage{xcolor}
% \usepackage{xspace}
% \lstset{language=TeX,
% backgroundcolor=\color{lightgray},
% basicstyle=\small\ttfamily,
% xleftmargin=3em}
\pagestyle{fancy}\addtolength{\headwidth}{20pt}
% \renewcommand{\chaptermark}[1]{\markboth{\thechapter.\#1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\#1}{}}
\definecolor{gray75}{gray}{0.75}
\newcommand{\hsp}{\hspace{20pt}}
\titleformat{\chapter}[hang]{\Huge\bfseries}{\thechapter\hsp\textcolor{gray75}{|}\hsp}{0pt}{\Huge\bfseries}
\cfoot{}
\rhead[\fancyplain{}{\bfseries\leftmark}]{\fancyplain{}
{\bfseries\thepage}}
\lhead[\fancyplain{}{\bfseries\thepage}]{\fancyplain{}
{\bfseries\rightmark}}
\begin{document}
\begin {flushright}
Dedica
\end {flushright}
\tableofcontents
\begin{table}[!ht]
\centering\scriptsize
\begin{tabular}{|c|m{4 cm}|m{4.5 cm}|m{3 cm}|}
\rowcolor{orange}
\rule[1ex]{0ex}{3ex}
Entità&Significato&Attributi&Identificatori \\
\midrule
Utente&
Utente finale registrato al servizio&
\begin{description}
\item{} Username - Stringa
\item{} Password - Stringa
\item{} Nome - Stringa
\item{} Cognome - Stringa
\item{} DataNascita - Data
\item{} PayPal - Stringa
\item{} IndirizzoDomicilio - Stringa
\end{description}
&
Username \\
\bottomrule
\end{tabular}
\caption{Tabella Entità}
\end{table}
\end{document}
答案1
booktabs
是的,如果包含包装的话,水平规则的上方和下方有分隔——这是该包装的一个很好的设计特点!
如果确实有必要:(不过这使得使用booktabs
基本上毫无用处!)
\toprule
由、\bottomrule
和midrule
(\cmidrule
均由包提供)制作的水平线上方和下方的间距booktabs
可以通过长度控制
\aboverulesep
和\belowrulesep
。将它们都设置为0pt
将导致分离消失:
\setlength{\aboverulesep}{0pt}
\setlength{\belowrulesep}{0pt}
我已经在table
环境中完成了此操作,以将更改限制在当前表,而不是全局表。
\documentclass[a4paper,11pt,twoside,openright]{book}
\usepackage[margin=1in]{geometry}
\usepackage[utf8x]{inputenc}
\usepackage[italian]{babel}
\usepackage[T1]{fontenc}
\usepackage{fancyhdr}
\usepackage{showkeys}
\usepackage{graphicx}
% per il testo attorno alle figure
\usepackage{floatflt,epsfig}
\usepackage{wrapfig}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{array}
% usare colori in tabella:
\usepackage{xcolor,colortbl}
\usepackage{titlesec}
%tabelle lunghe (gestione oltre il margine)
\usepackage{longtable}
\usepackage{ltablex}
\pagestyle{fancy}\addtolength{\headwidth}{20pt}
% \renewcommand{\chaptermark}[1]{\markboth{\thechapter.\#1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\#1}{}}
\definecolor{gray75}{gray}{0.75}
\newcommand{\hsp}{\hspace{20pt}}
\titleformat{\chapter}[hang]{\Huge\bfseries}{\thechapter\hsp\textcolor{gray75}{|}\hsp}{0pt}{\Huge\bfseries}
\cfoot{}
\rhead[\fancyplain{}{\bfseries\leftmark}]{\fancyplain{}
{\bfseries\thepage}}
\lhead[\fancyplain{}{\bfseries\thepage}]{\fancyplain{}
{\bfseries\rightmark}}
\begin{document}
\begin {flushright}
Dedica
\end {flushright}
\tableofcontents
\begin{table}[!ht]
\setlength{\aboverulesep}{0pt}
\setlength{\belowrulesep}{0pt}
\centering\scriptsize
\begin{tabular}{|c|m{4 cm}|m{4.5 cm}|m{3 cm}|}
\rowcolor{orange}
\rule[1ex]{0ex}{3ex} %%%% Why???? Why not \toprule with other thickness?
Entità&Significato&Attributi&Identificatori \\
\midrule
Utente&
Utente finale registrato al servizio&
\begin{description}
\item{} Username - Stringa
\item{} Password - Stringa
\item{} Nome - Stringa
\item{} Cognome - Stringa
\item{} DataNascita - Data
\item{} PayPal - Stringa
\item{} IndirizzoDomicilio - Stringa
\end{description}
&
Username \\
\bottomrule
\end{tabular}
\caption{Tabella Entità}
\end{table}
\end{document}