我想将下面的表格放在一个页面中,无论是横向还是纵向,但不幸的是我无法做到。请问有人可以帮忙将它放到页面上吗?
\usepackage{lscape}
\usepackage{booktabs}
\usepackage{amssymb}
\begin{landscape}
\begin{table}[htbp]
\centering
\caption{Add caption}
\begin{tabular}{crrrrrrrrrrrrrrrrrrrrr}
\toprule
Tool Name & \multicolumn{1}{c}{Dymola} & \multicolumn{1}{c}{Matlab/Simulink} & \multicolumn{1}{c}{ETAP} & \multicolumn{1}{c}{PSS/E} & \multicolumn{1}{c}{Homer Pro} & \multicolumn{1}{c}{Moasik} & \multicolumn{1}{c}{ATP Designer} & \multicolumn{1}{c}{NEPLAN} & \multicolumn{1}{c}{Transmission 2000} & \multicolumn{1}{c}{CYME} & \multicolumn{1}{c}{DIgSILENT
(PowerFactory)} & \multicolumn{1}{c}{SynerGEE
Electric} & \multicolumn{1}{c}{CAPE} & \multicolumn{1}{c}{Eurostag} & \multicolumn{1}{c}{IPSA 2} & \multicolumn{1}{c}{MILSOFT
Windmil} & \multicolumn{1}{c}{SimPowerSystems} & \multicolumn{1}{c}{MicroTran} & \multicolumn{1}{c}{DSATools} & \multicolumn{1}{c}{SIMPOW} & \multicolumn{1}{c}{SKM
Power*Tools} \\
\midrule
\textbf{Simulation Capabilities} & & & & & & & & & & & & & & & & & & & & & \\
Dynamic Simulation & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} \\
Power Flow Calculations & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} \\
Renewable Energies modeling (PV \& Wind) & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{P} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{-----} \\
\textbf{Other capabilities } & & & & & & & & & & & & & & & & & & & & & \\
is Programing required ? & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{-----} \\
Ability to export/import to other software & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{-----} \\
Verified Library & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} \\
Availability in HS & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{-----} & \multicolumn{1}{c}{-----} \\
\bottomrule
\end{tabular}%
\label{tab:addlabel}%
\end{table}%
\end{landscape}
答案1
那么以下内容如何:
\documentclass{article}
\usepackage{pdflscape}
\usepackage{booktabs}
\usepackage{amssymb}
\usepackage{graphicx}
\newcommand*\rot{\rotatebox{90}}
\begin{document}
\begin{landscape}
\begin{table}%[htbp]
\centering
\caption{Add caption}
\setlength{\tabcolsep}{4pt}
\begin{tabular}{p{4.5cm}ccccccccccccccccccccc}
% \toprule
Tool Name & \rot{Dymola} & \rot{Matlab/Simulink} & \rot{ETAP} & \rot{PSS/E} & \rot{Homer Pro} & \rot{Moasik} & \rot{ATP Designer} & \rot{NEPLAN} & \rot{Transmission 2000} & \rot{CYME} & \rot{DIgSILENT (PowerFactory)} & \rot{SynerGEE Electric} & \rot{CAPE} & \rot{Eurostag} & \rot{IPSA 2} & \rot{MILSOFT Windmil} & \rot{SimPowerSystems} & \rot{MicroTran} & \rot{DSATools} & \rot{SIMPOW} & \rot{SKM Power*Tools} \\
\midrule
\multicolumn{2}{l}{\textbf{Simulation Capabilities}} & & & & & & & & & & & & & & & & & & & & \\
Dynamic Simulation & \checkmark & \checkmark & \checkmark & \checkmark & --- & --- & \checkmark & \checkmark & --- & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & --- & \checkmark & --- & \checkmark & \checkmark & \checkmark \\
Power Flow Calculations & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark \\
\hangindent=0.5cm\raggedright
Renewable Energies modeling (PV \& Wind)
& \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & --- & \checkmark & P & \checkmark & --- & \checkmark & \checkmark & \checkmark & \checkmark & --- & \checkmark & --- & --- \\
\textbf{Other capabilities} & & & & & & & & & & & & & & & & & & & & & \\
is Programing required? & \checkmark & \checkmark & --- & --- & --- & \checkmark & --- & \checkmark & --- & \checkmark & \checkmark & \checkmark & --- & --- & \checkmark & --- & \checkmark & --- & --- & --- & --- \\
\hangindent=0.5cm\raggedright
Ability to export/import to other software & \checkmark & \checkmark & \checkmark & --- & --- & \checkmark & \checkmark & \checkmark & --- & \checkmark & \checkmark & --- & --- & --- & --- & --- & \checkmark & --- & \checkmark & --- & --- \\
Verified Library & \checkmark & \checkmark & \checkmark & \checkmark & --- & \checkmark & --- & \checkmark & --- & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & --- & \checkmark & \checkmark & \checkmark \\
Availability in HS & \checkmark & \checkmark & --- & --- & --- & --- & --- & --- & --- & --- & \checkmark & --- & --- & --- & --- & --- & --- & --- & --- & --- & --- \\
\bottomrule
\end{tabular}%
\label{tab:addlabel2}%
\end{table}%
\end{landscape}
这些想法是:
- 使用横向模式(包
lscape
或pdflscape
) - 旋转列的长标题(
\rotatebox
来自包graphicx
) - 将两个最长的行标题分散到两行:第一列使用
p{4.5cm}
而不是c
。为了防止标题“模拟功能”中出现换行符,可以使用\multicolumn
。为了使换行符清晰,请将其左对齐并缩进第二行。 - 将列间距从 6pt(标准值)减少到 4pt。
- 替换
-----
为---
(按照 David Carlisle 的建议)
根据 Christian Lindig 的建议,也可以将列标题旋转其他角度;请参阅表格中的列标题旋转。这当然会增加标题的宽度,因此必须注意不要再次增加列间距。这可以通过 来实现\rlab
。示例:
\newcommand*\rot[1]{\rotatebox{60}{\rlap{#1}}}
答案2
交换行和列,它可以适合横向页面:
\documentclass[ a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[margin=3cm]{geometry}
\usepackage{lscape}
\usepackage{fourier}
\usepackage{erewhon}
\usepackage{amsmath, amssymb}
\usepackage{array}
\usepackage{caption, booktabs}
\captionsetup{labelfont=sc}
\usepackage{tabularx}
\usepackage{makecell}
\renewcommand\theadfont{\bfseries}
\setcellgapes[t]{5pt}
\newcommand\niet{\multicolumn{1}{c}{---}}
\begin{document}
\begin{landscape}
\begin{table}[htbp]
\centering\setlength\tabcolsep{5pt}
\caption{Add caption} \label{tab:addlabel}%
\makegapedcells
\begin{tabular}{l*{3}{>{\checkmark}c}*{4}{>{\checkmark}c}}
& \multicolumn{3}{c}{\bfseries Simulation Capabilities} & \multicolumn{4}{c}{\bfseries Other Capabilities}\\
\cmidrule(lr){2-4} \cmidrule(lr){5-8}
Tool Name & \multicolumn{1}{c}{\makecell{Dynamic\\ Simulation}} & \multicolumn{1}{c}{\makecell{Power Flow\\ Calculations}} & \multicolumn{1}{c}{\makecell{Renewable Energies\\ modeling (PV \& Wind)}} & \multicolumn{1}{c}{\makecell{is Programing\\ required ?}} & \multicolumn{1}{c}{\makecell{Ability to export/import\\ to other software}} & \multicolumn{1}{c}{\makecell{Verified\\ Library}} & \multicolumn{1}{c}{\makecell{Availability\\ in HS}}\\
\midrule[\heavyrulewidth]
Dymola & & & & & & & \\
Matlab/Simulink & & & & & & & \\
ETAP & & & & \niet & & & \niet \\
PSS/E & & & & \niet & \niet & & \niet \\
Homer Pro & \niet & & & \niet & \niet & \niet & \niet \\
Moasik & \niet & & & & & & \niet \\
ATP Designer & & & & \niet & & \niet & \niet \\
NEPLAN & & & & & & & \niet \\
Transmission 2000 & \niet & & \niet & \niet & \niet & \niet & \niet \\
CYME & & & & & & & \niet \\
DIgSILENT (PowerFactory) & & \multicolumn{1}{c}{P} & & & & & \\
SynerGEE Electric & & & & & \niet & & \niet \\
CAPE & & & \niet & \niet & \niet & & \niet \\
Eurostag & & & & \niet & \niet & & \niet \\
IPSA 2 & & & & & \niet & & \niet \\
MILSOFT Windmil & \niet & & & \niet & \niet & & \niet \\
SimPowerSystems & & & & & & & \niet \\
MicroTran & \niet & & \niet & \niet & \niet & \niet & \niet \\
DSATools & & & & \niet & & & \niet \\
SIMPOW & & & \niet & \niet & \niet & & \niet \\
SKM Power*Tools & & & \niet & \niet & \niet & & \niet \\
\bottomrule
\end{tabular}%
\end{table}%
\end{landscape}
\end{document}