1

i have long sentences in the cells of my table, i want to wrap the text so the table fits into the page. Currently the table exceeds the page width. Below i my code generated with Excel2LateX

\begin{table}[htbp]
  \centering
  \caption{Add caption}
    \begin{tabular}{llll}
    \toprule
    \multicolumn{1}{c}{\textbf{Strategy}} & \multicolumn{1}{c}{\textbf{Application area/sector}} & \multicolumn{1}{c}{\textbf{Advantages}} & \multicolumn{1}{c}{\textbf{Limitations}} \\
    \midrule
    \midrule
    Enhance energy efficiency and energy conservation & Applied mainly in commercial and industrial buildings & Energy saving from 10\% to 20\% easily achievable. & May involve extensive capital investment for installation of energy saving device. \\
    \midrule
    Increase usage of clean fuels & Substitution of coal by natural gas for power generation. & Natural gas emits 40Ð50\% less CO2 than coal due to its lower carbon content and higher combustion efficiency; cleaner exhaust gas (lower particulates and sulfur dioxide emissions). & Higher fuel cost for conventional natural gas. Comparable cost for shale gas. \\
    \midrule
    Adopt clean coal technologies & Integrated gasification combined cycle (IGCC), pressurized fluidized bed combustor (PFBC) etc. to replace conventional combustion. & Allow the use of coal with lower emissions of air pollutants. & Significant investment needed to roll out technologies widely. \\
    \midrule
    Use of renewable energy & Hydro, solar (thermal), wind power,
and biofuels highly developed. & Use of local natural resources; no or low greenhouse and toxic gas emissions. & Applicability may depend on local resources availability and cost. Power from solar, wind, marine etc. are intermittent and associated technologies are not mature; most current renewable energies are more costly than conventional energy. \\
    \midrule
    Development of nuclear power & Nuclear fission adopted mainly in US, France, Japan, Russia and China. Nuclear fusion still in research and development phase. & No air pollutant and greenhouse gas emissions. & Usage is controversial; development of world's nuclear power is hindered due to the Fukushima Nuclear Accident in 2011, e.g. Germany will phase out all its nuclear power by 2022. \\
    \midrule
    Afforestation and reforestation & Applicable to all countries & Simple approach to create natural and sustainable CO2 sinks. & Restricts/prevents land use for other applications \\
    \midrule
    Carbon capture and storage & Applicable to large CO2 point emission sources. & It can reduce vast amount of CO2 with capture efficiency 480\%. & CCS full chain technologies not proven at full commercial scale \\
    \bottomrule
    \end{tabular}%
  \label{tab:addlabel}%
\end{table}%
1
  • 1
    Welcome to TeX.SX! Please help us (and also you) and add a minimal working example (MWE), that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass and ending with \end{document}. Does Fit large table horizontally into a page help you?
    – Bobyandbob
    Jun 3, 2017 at 11:29

2 Answers 2

1

For a table like this you should not use the l-column type. Instead the p{<width>} type should be used, which defines a column of the specified width:

\documentclass[]{article}

\usepackage[margin=2.5cm]{geometry}

\usepackage{booktabs}

\begin{document}

\newdimen\allcolwidth
\allcolwidth=\dimexpr\textwidth-8\tabcolsep\relax% this sets a width which is as wide as possible with 4 columns in a table

\begin{table}[htbp]
  \centering
  \caption{Add caption}
  \begin{tabular}{p{0.15\allcolwidth}p{0.25\allcolwidth}p{0.25\allcolwidth}p{0.35\allcolwidth}}
    \toprule
    \multicolumn{1}{c}{\textbf{Strategy}} &
    \multicolumn{1}{p{0.25\allcolwidth}}{\centering\textbf{Application area/sector}} & \multicolumn{1}{c}{\textbf{Advantages}} & \multicolumn{1}{c}{\textbf{Limitations}} \\
    \midrule
    \midrule
    Enhance energy efficiency and energy conservation & Applied mainly in commercial and industrial buildings & Energy saving from 10\% to 20\% easily achievable. & May involve extensive capital investment for installation of energy saving device. \\
    \midrule
    Increase usage of clean fuels & Substitution of coal by natural gas for power generation. & Natural gas emits 40Ð50\% less CO2 than coal due to its lower carbon content and higher combustion efficiency; cleaner exhaust gas (lower particulates and sulfur dioxide emissions). & Higher fuel cost for conventional natural gas. Comparable cost for shale gas. \\
    \midrule
    Adopt clean coal technologies & Integrated gasification combined cycle (IGCC), pressurized fluidized bed combustor (PFBC) etc. to replace conventional combustion. & Allow the use of coal with lower emissions of air pollutants. & Significant investment needed to roll out technologies widely. \\
    \midrule
    Use of renewable energy & Hydro, solar (thermal), wind power,
and biofuels highly developed. & Use of local natural resources; no or low greenhouse and toxic gas emissions. & Applicability may depend on local resources availability and cost. Power from solar, wind, marine etc. are intermittent and associated technologies are not mature; most current renewable energies are more costly than conventional energy. \\
    \midrule
    Development of nuclear power & Nuclear fission adopted mainly in US, France, Japan, Russia and China. Nuclear fusion still in research and development phase. & No air pollutant and greenhouse gas emissions. & Usage is controversial; development of world's nuclear power is hindered due to the Fukushima Nuclear Accident in 2011, e.g. Germany will phase out all its nuclear power by 2022. \\
    \midrule
    Afforestation and reforestation & Applicable to all countries & Simple approach to create natural and sustainable CO2 sinks. & Restricts/prevents land use for other applications \\
    \midrule
    Carbon capture and storage & Applicable to large CO2 point emission sources. & It can reduce vast amount of CO2 with capture efficiency 480\%. & CCS full chain technologies not proven at full commercial scale \\
    \bottomrule
    \end{tabular}%
  \label{tab:addlabel}%
\end{table}%
\end{document}

enter image description here

For a table this wide, you might as well insert a sidewaystable (provided by the rotating-package):

\documentclass[]{article}

\usepackage[margin=2.5cm]{geometry}

\usepackage{booktabs}
\usepackage{rotating}

\newdimen\allcolwidth

\begin{document}
\begin{sidewaystable}
  \allcolwidth=\dimexpr\textwidth-8\tabcolsep\relax%this sets a width which is as possible with 4 columns
  \centering
  \caption{Add caption}
  \begin{tabular}{p{0.15\allcolwidth}p{0.25\allcolwidth}p{0.25\allcolwidth}p{0.35\allcolwidth}}
    \toprule
    \multicolumn{1}{c}{\textbf{Strategy}} &
    \multicolumn{1}{p{0.25\allcolwidth}}{\centering\textbf{Application area/sector}} & \multicolumn{1}{c}{\textbf{Advantages}} & \multicolumn{1}{c}{\textbf{Limitations}} \\
    \midrule
    \midrule
    Enhance energy efficiency and energy conservation & Applied mainly in commercial and industrial buildings & Energy saving from 10\% to 20\% easily achievable. & May involve extensive capital investment for installation of energy saving device. \\
    \midrule
    Increase usage of clean fuels & Substitution of coal by natural gas for power generation. & Natural gas emits 40Ð50\% less CO2 than coal due to its lower carbon content and higher combustion efficiency; cleaner exhaust gas (lower particulates and sulfur dioxide emissions). & Higher fuel cost for conventional natural gas. Comparable cost for shale gas. \\
    \midrule
    Adopt clean coal technologies & Integrated gasification combined cycle (IGCC), pressurized fluidized bed combustor (PFBC) etc. to replace conventional combustion. & Allow the use of coal with lower emissions of air pollutants. & Significant investment needed to roll out technologies widely. \\
    \midrule
    Use of renewable energy & Hydro, solar (thermal), wind power,
and biofuels highly developed. & Use of local natural resources; no or low greenhouse and toxic gas emissions. & Applicability may depend on local resources availability and cost. Power from solar, wind, marine etc. are intermittent and associated technologies are not mature; most current renewable energies are more costly than conventional energy. \\
    \midrule
    Development of nuclear power & Nuclear fission adopted mainly in US, France, Japan, Russia and China. Nuclear fusion still in research and development phase. & No air pollutant and greenhouse gas emissions. & Usage is controversial; development of world's nuclear power is hindered due to the Fukushima Nuclear Accident in 2011, e.g. Germany will phase out all its nuclear power by 2022. \\
    \midrule
    Afforestation and reforestation & Applicable to all countries & Simple approach to create natural and sustainable CO2 sinks. & Restricts/prevents land use for other applications \\
    \midrule
    Carbon capture and storage & Applicable to large CO2 point emission sources. & It can reduce vast amount of CO2 with capture efficiency 480\%. & CCS full chain technologies not proven at full commercial scale \\
    \bottomrule
    \end{tabular}%
  \label{tab:addlabel2}%
\end{sidewaystable}
\end{document}

enter image description here

0

With use of \makecell and tabularx for table, ragged2e and \small font size for better text aligning in cells and reduced \tabcolsep size gives:

enter image description here

\documentclass{article}
\usepackage[margin=2.5cm]{geometry}
\usepackage{booktabs, makecell, tabularx}
    \renewcommand\theadfont{\bfseries\normalsize}
\usepackage{ragged2e}
\usepackage{siunitx}

\begin{document}
    \begin{table}[htbp]
\centering
    \caption{Add caption}
\label{tab:addlabel}%
    \setlength\tabcolsep{3pt}
    \small
    \begin{tabularx}{\linewidth}{@{}>{\hsize=0.7\hsize\RaggedRight}X
                             *{3}{>{\hsize=1.1\hsize\RaggedRight}X}
                              @{}}
    \toprule
\thead[b]{Strategy} 
    &   \thead[b]{Application\\ area/sector}
        &   \thead[b]{Advantages}
            & \thead[b]{Limitations}                \\
    \midrule
Enhance energy efficiency and energy conservation
    &   Applied mainly in commercial and industrial buildings 
        &   Energy saving from \SIrange{10}{20}{\%} easily achievable. 
            &   May involve extensive capital investment for installation of energy saving device. \\
    \midrule
Increase usage of clean fuels 
    &   Substitution of coal by natural gas for power generation. 
        &   Natural gas emits \SIrange{10}{20}{\%} less CO2 than coal due to its lower carbon content and higher combustion efficiency; cleaner exhaust gas (lower particulates and sulfur dioxide emissions). 
            &   Higher fuel cost for conventional natural gas. Comparable cost for shale gas.      \\
    \midrule
Adopt clean coal technologies 
    &   Integrated gasification combined cycle (IGCC), pressurized fluidized bed combustor (PFBC) etc. to replace conventional combustion. 
        &   Allow the use of coal with lower emissions of air pollutants. 
            &   Significant investment needed to roll out technologies widely. \\
    \midrule
Use of renewable energy 
    &   Hydro, solar (thermal), wind power,
and biofuels highly developed. 
        &   Use of local natural resources; no or low greenhouse and toxic gas emissions. 
            &   Applicability may depend on local resources availability and cost. Power from solar, wind, marine etc. are intermittent and associated technologies are not mature; most current renewable energies are more costly than conventional energy. \\
    \midrule
Development of nuclear power 
    &   Nuclear fission adopted mainly in US, France, Japan, Russia and China. Nuclear fusion still in research and development phase. 
        &   No air pollutant and greenhouse gas emissions. 
            &   Usage is controversial; development of world's nuclear power is hindered due to the Fukushima Nuclear Accident in 2011, e.g. Germany will phase out all its nuclear power by 2022. \\
    \midrule
Afforestation and reforestation 
    &   Applicable to all countries 
        &   Simple approach to create natural and sustainable CO2 sinks. 
            &   Restricts/prevents land use for other applications \\
    \midrule
Carbon capture and storage 
    &   Applicable to large CO2 point emission sources. 
        &   It can reduce vast amount of CO2 with capture efficiency \SI{480}{\%}. 
            &   CCS full chain technologies not proven at full commercial scale \\
    \bottomrule
    \end{tabularx}%
\end{table}%
\end{document}

You must log in to answer this question.

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