3

I'm trying to fit the below table in one page either in landscape or portrait but unfortunately i'm not able to do it. please anyone can help getting it on page ??

\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}
8
  • Welcome to TeX.SX Please, see our starter guide to learn about our style.
    – osjerick
    Commented Oct 23, 2015 at 12:39
  • Probably, you should swap rows and columns. Are your column heads really one-word?
    – Bernard
    Commented Oct 23, 2015 at 12:58
  • 1
    ----- the first three ligature to an em-dash and the second two ligature to an en-dash leaving two adjacent dashes of different lengths. Is that really what you want here? Commented Oct 23, 2015 at 13:01
  • Why all the multicolumns? Is replacing the column headers with abbreviations an option? (similar to Getting a landscape table to work!, though I realize that situation is a bit different) Commented Oct 23, 2015 at 13:04
  • (Never mind that last suggestion of mine, don't think it's sufficient.) Commented Oct 23, 2015 at 13:13

2 Answers 2

4

How about the following:

\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}

The ideas are:

  1. Use landscape mode (package lscape or pdflscape)
  2. Rotate the long captions of the columns (\rotatebox from package graphicx)
  3. Spread the two longest row captions over two lines: use p{4.5cm} instead of c for the first column. To prevent a line break in the title caption "Simulation Capabilities" one can use a \multicolumn. To make the line break clear, make it left aligned and indent the second lines.
  4. Decrease the column separation from 6pt (standard value) to 4pt.
  5. Replace ----- by --- (as suggested by David Carlisle)

The table

As suggested by Christian Lindig, it is also possible to rotate the column headers by some other angle; see Rotated column titles in tabular. This increases the width of the headers, of course, and so one has to take care, that this does not again increase the column separation. This can be achieved with \rlab. Example:

\newcommand*\rot[1]{\rotatebox{60}{\rlap{#1}}}
2
  • I like it. Since you are rotating the labels anyway: how about rotating them such that they go slightly diagonal from top-left to bottom-right? This would make them easier to read and the space is available. Commented Oct 23, 2015 at 15:38
  • 1
    @ChristianLindig Yes, I agree. I'll mention it in the answer.
    – jarauh
    Commented Oct 23, 2015 at 15:56
4

Swapping rows and columns, it can fit a landscape page:

\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} 

enter image description here

4
  • I like the idea of haven \checkmark as the standard entry. Question: For what do you need \makecell and why do you add the many & between "Dynamic" and "Simulation"?
    – jarauh
    Commented Oct 23, 2015 at 15:55
  • Looks like those &s actually cause a Extra alignment tab has been changed to \cr… I don't think that could be because I commented out erewhon since I don't have it…
    – MickG
    Commented Oct 23, 2015 at 17:11
  • @MickG erewhon seems to be a font. It would be nice if @Bernard could minimalize his example and make it better understandable.
    – jarauh
    Commented Oct 23, 2015 at 20:11
  • 1
    Erewhon is an extension to Adobe Utopia, on which Fourier is based. I used it only because it adds true small caps to Utopia ( for caption label). You may safely delete it. For the many & between ‘Dynamic’ and ‘Simulation’, they result from a problem with my editor, I'm sorry I didn't notice them on posting. I've updated the code, and you should have no problem now. The makecell command (and package) allows for line breaks in cells of the second row. Also, \setcellgapes, from the same packages, defines some vertical padding for rows, activated by the \makegapedcells switch.
    – Bernard
    Commented Oct 23, 2015 at 20:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .