TransWikia.com

LaTex multirow overlaping with next row

TeX - LaTeX Asked by dolandluck on June 6, 2021

Im having an issue with my code. Im new to latex and I used a table editor to generate the codes for me. I would like to make a table like the one below however the rows end up overlapping (also shown below).

What I want the table to be

The resulting table

usepackage{graphicx}
 usepackage{multirow}
    begin{table*}
    centering
    caption{FMEA analysis on the possible failure modes of the fan blade.}
    label{tab:FMEA}
    resizebox{linewidth}{!}{%
    begin{tabular}{clclcclc} 
    hline
    Failure Mode               & multicolumn{1}{c}{Effects}                                                                                                                                                                                                                                     & S                  & multicolumn{1}{c}{Causes}                                                                              & P                      & D                     & multicolumn{1}{c}{Design Considerations}                                                                                                & RPN   
    hline
    multirow{2}{*}{Fatigue}   & multirow{2}{*}{begin{tabular}[c]{@{}l@{}}1) Fan will be inoperable until fan blade replaced.  2) Failure during operation may  lead to injuries or damages to other equipment. end{tabular}}                                                       & multirow{2}{*}{9} & begin{tabular}[c]{@{}l@{}}Alternating load cycles  when RPM is decreased or increasedend{tabular} & 8                      & 6                     & begin{tabular}[c]{@{}l@{}}1)Reduce the frequency of RPM change and reduce deformation during loading. end{tabular}                 & 432  
                               &                                                                                                                                                                                                                                                                 &                    & begin{tabular}[c]{@{}l@{}}High temperature induces  propagation of microcracksend{tabular}          & 9                      & 1                     & begin{tabular}[c]{@{}l@{}}2) Operating temperature (400 C) must not be higher than 0.3$T_m$ of  selected material. end{tabular}  & 81    
    hline
    multirow{2}{*}{Corrosion} & multirow{2}{*}{begin{tabular}[c]{@{}l@{}}1) Surface imperfections caused by corrosion increase drag, reducing the fan efficiency.  2) Reduces structural integrity of the fan blades which increases chances of premature failure.~end{tabular}} & multirow{2}{*}{6} & begin{tabular}[c]{@{}l@{}}Abrasion and degradation of anti-corrosion coatingend{tabular}            & 10                     & 2                     & begin{tabular}[c]{@{}l@{}}1) Select a more corrosion-resistant material to reduce reliance on anti-corrosion coatings.end{tabular} & 120  
                               &                                                                                                                                                                                                                                                                 &                    & Pitting corrosion                                                                                       & 7                      & 6                     & begin{tabular}[c]{@{}l@{}}2) Avoid passive metals for the construction of the blade.end{tabular}                                     & 252   
    hline
    multirow{2}{*}{Creep}     & multirow{2}{*}{begin{tabular}[c]{@{}l@{}}1) May result in loss of performance if blade is deformed, or injuries if catastrophic failure occurs.  2) More frequent blade replacements would increase operating costs end{tabular}}                & multirow{2}{*}{9} & begin{tabular}[c]{@{}l@{}}Constant loading of the fan bladesend{tabular}                            & 9                      & 4                     & begin{tabular}[c]{@{}l@{}}1) Finite element analysis may help obtain the most optimal blade geometry.end{tabular}                  & 324  
                               &                                                                                                                                                                                                                                                                 &                    & begin{tabular}[c]{@{}l@{}}High temperature increases dislocation mobilityend{tabular}               & 9                      & 1                     & begin{tabular}[c]{@{}l@{}}2) The operating temperature (400 C) must not  exceed 0.5$T_m$ of the materialend{tabular}               & 81    
    hline
    Impact                     & begin{tabular}[c]{@{}l@{}}1) Damage surface and reduceaerodynamic efficiency of the blade.  2) A large object may cause deformation or complete failure of the blade, deeming the machine inoperable. end{tabular}                                  & 9                  & begin{tabular}[c]{@{}l@{}}Ingestion of solid objects into the fan end{tabular}                      & multicolumn{1}{l}{10} & multicolumn{1}{l}{2} & begin{tabular}[c]{@{}l@{}}The blades must be inspected frequently for surface damage or any deformation. end{tabular}              & 180  
    hline
    end{tabular}
    }
    end{table*}

2 Answers

I think it would be best to let LaTeX do the line breaking, and therefore use p{...} columns for the multiline texts. This makes the code much simpler. The other columns can be positioned with multirow, but they need some manual tuning (using the actual number of lines in the other columns as nrows in multirow). So here is my solution. (I use makecell only to get "gapes".)

enter image description here

documentclass{article}
usepackage{booktabs}
usepackage{multirow}
usepackage{makecell}
usepackage[paperwidth=30cm]{geometry}

begin{document}
    begin{table*}
        centering
        caption{FMEA analysis on the possible failure modes of the fan blade.}
        label{tab:FMEA}
setcellgapes{5pt}
makegapedcells

            begin{tabular}{ccp{5cm}cp{4cm}ccp{6cm}c} 
% 1 header
toprule
1                  & Failure mode               & Effects                                                                                                                                                               & S                  & Causes                                                                                 & P                   & D                  & Design Considerations                                                                                                                                       & RPN                  
 midrule 
multirow{2}{*}{2}                  & multirow{7}{*}{Fatigue}   & 1) Fan will be inoperable until fan blade replaced.                                                                                                                   & multirow{7}{*}{9} & Alternating load cycles when RPM is decreased or increased                             & 8                   & 6                  & 1) Reduce the frequency of RPM change and reduce deformation during loading.                                                                                & multirow{2}{*}{432}                  
multirow{3}{*}{3}                  &                            & 2) Failure during operation may lead to injuries or damages to other equipment.                                                                                       &                    & High temperature induces propagation of microcracks                                    & 9                   & 1                  & 2) Operating temperature (400 C) must not be higher than 0.3$T_m$ of selected material.                                                                     & multirow{3}{*}{81}                   
midrule
4                  & multirow{7}{*}{Corrosion} & 1) Surface imperfections caused by corrosion increase drag, reducing the fan efficiency.                                                                              & multirow{7}{*}{6} & Abrasion and degradation of anti-corrosion coating                                     & 10                  & 2                  & 1) Select a more corrosion-resistant material to reduce reliance on anti-corrosion coatings.                                                                & 120                  
5                  &                            & 2) Reduces structural integrity of the fan blades which increases chances of premature failure.                                                                       &                    & Pitting Corrosion                                                                      & 7                   & 6                  & 2) Avoid passive metals for the construction of the blade.                                                                                                  & 252                  
 midrule
6                  & multirow{8}{*}{Creep}     & 1) May result in loss of performance if blade is deformed, or injuries if catastrophic failure occurs.                                                                & multirow{8}{*}{9} & Constant loading of the fan blades                                                     & 9                   & 4                  & 1) Finite element analysis may help obtain the most optimal blade geometry.                                                                                 & 324                  
7                  &                            & 2) More frequent blade replacements would increase operating costs                                                                                                    &                    & High temperature increases dislocation mobility          & 9                   & 1                  & 2) The operating temperature (400 C) must not exceed 0.5$T_m$ of the material                                                                               & 81                   
 midrule
multirow{8}{*}{8} & multirow{8}{*}{Impact}    & 1) Damage surface and reduce aerodynamic efficiency of the blade.                                                                      & multirow{8}{*}{9} & multirow{8}{=}{Ingestion of solid objects into the fan} & multirow{8}{*}{10} & multirow{8}{*}{2} & multirow{8}{=}{The blades must be inspected frequently for surface damage or any deformation.} & multirow{8}{*}{180} 
                   &                            & 2) A large object may cause deformation or complete failure of the blade, deeming the machine inoperable. &                    &                                                                                        &                     &                    &                                                                                                                                                             &                       
 bottomrule

            end{tabular}
%       }
    end{table*}
end{document} 

Correct answer by Pieter van Oostrum on June 6, 2021

I have changed the code in the paragraph title Corrosion and Creep with package makecell which is better than creating tables within the tabular environ -- have look -- also using package booktabs and using toprule, midrule, bottomrule gives better spacing -- you can follow the same for the rest of the table -- will give you the desired result

makecell[l]{1) Surface imperfections caused by corrosion increase drag, reducing the fan efficiency. 2) Reduces structural integrity of the fan blades which increases chances of premature failure.~}

enter image description here

Partial code changed MWE -- remaining left for the OP

documentclass{article}
usepackage{subcaption}
usepackage{booktabs}
usepackage{multirow}
usepackage{makecell}
renewcommandthesubfigure{1alphalph{value{subfigure}}}

begin{document}
    begin{table*}
        centering
        caption{FMEA analysis on the possible failure modes of the fan blade.}
        label{tab:FMEA}
%       resizebox{linewidth}{!}{%
            begin{tabular}{clclcclc} 
                toprule
                Failure Mode               & multicolumn{1}{c}{Effects}                                                                                                                                                                                                                                     & S                  & multicolumn{1}{c}{Causes}                                                                              & P                      & D                     & multicolumn{1}{c}{Design Considerations}                                                                                                & RPN   
                midrule
                multirow{2}{*}{Fatigue}   & multirow{2}{*}{begin{tabular}[c]{@{}l@{}}1) Fan will be inoperable until fan blade replaced.  2) Failure during operation may  lead to injuries or damages to other equipment. end{tabular}}                                                       & multirow{2}{*}{9} & begin{tabular}[c]{@{}l@{}}Alternating load cycles  when RPM is decreased or increasedend{tabular} & 8                      & 6                     & begin{tabular}[c]{@{}l@{}}1)Reduce the frequency of RPM change and reduce deformation during loading. end{tabular}                 & 432  
                &                                                                                                                                                                                                                                                                 &                    & begin{tabular}[c]{@{}l@{}}High temperature induces  propagation of microcracksend{tabular}          & 9                      & 1                     & begin{tabular}[c]{@{}l@{}}2) Operating temperature (400 C) must not be higher than 0.3$T_m$ of  selected material. end{tabular}  & 81    
                midrule
                multirow{2}{*}{Corrosion} & makecell[l]{1) Surface imperfections caused by corrosion increase drag, reducing the fan efficiency. 2) Reduces structural integrity of the fan blades which increases chances of premature failure.~} & multirow{2}{*}{6} & begin{tabular}[c]{@{}l@{}}Abrasion and degradation of anti-corrosion coatingend{tabular}            & 10                     & 2                     & begin{tabular}[c]{@{}l@{}}1) Select a more corrosion-resistant material to reduce reliance on anti-corrosion coatings.end{tabular} & 120  
                &                                                                                                                                                                                                                                                                 &                    & Pitting corrosion                                                                                       & 7                      & 6                     & begin{tabular}[c]{@{}l@{}}2) Avoid passive metals for the construction of the blade.end{tabular}                                     & 252   
                midrule
                multirow{2}{*}{Creep}     & makecell[l]{1) May result in loss of performance if blade is deformed, or injuries if catastrophic failure occurs.  2) More frequent blade replacements would increase operating costs }                & multirow{2}{*}{9} & begin{tabular}[c]{@{}l@{}}Constant loading of the fan bladesend{tabular}                            & 9                      & 4                     & begin{tabular}[c]{@{}l@{}}1) Finite element analysis may help obtain the most optimal blade geometry.end{tabular}                  & 324  
                &                                                                                                                                                                                                                                                                 &                    & begin{tabular}[c]{@{}l@{}}High temperature increases dislocation mobilityend{tabular}               & 9                      & 1                     & begin{tabular}[c]{@{}l@{}}2) The operating temperature (400 C) must not  exceed 0.5$T_m$ of the materialend{tabular}               & 81    
                midrule
                Impact                     & begin{tabular}[c]{@{}l@{}}1) Damage surface and reduceaerodynamic efficiency of the blade.  2) A large object may cause deformation or complete failure of the blade, deeming the machine inoperable. end{tabular}                                  & 9                  & begin{tabular}[c]{@{}l@{}}Ingestion of solid objects into the fan end{tabular}                      & multicolumn{1}{l}{10} & multicolumn{1}{l}{2} & begin{tabular}[c]{@{}l@{}}The blades must be inspected frequently for surface damage or any deformation. end{tabular}              & 180  
                bottomrule
            end{tabular}
%       }
    end{table*}
end{document} 

Answered by js bibra on June 6, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP