Size of cells in multirow and multicolumn environment












1















I have the following table and I am trying to give a specific length for column 1, 2 and 3 which stays fixed. I found a trick by adding an "invisible" row at the bottom (& multicolumn{1}{p{3.5cm}}{} & multicolumn{1}{p{3.5cm}}{}) but it doesn't seem a nice solution since I get obviously an empty row before my explanation of the table. Without that invisible row, although I put the sizes at the beginning of the table (begin{tabular}{m{8.2cm} m{3.5} m{3.5cm}}), the table just adapt to the content and it is not what I want.



Do you have any solution? It is the first time I do some table like that in Latex therefore I think the code is highly "inefficient and weird".



Thank you!



documentclass[11pt,a4paper]{article}
renewcommand{baselinestretch}{1.5}
renewcommandthesection{arabic{section}}
renewcommandthesubsection{thesection.arabic{subsection}}
usepackage{float}
usepackage{array}
usepackage{multirow}
usepackage{arydshln}
usepackage{geometry}
usepackage[font=small, justification=justified, format=plain]{caption}


begin{document}

begin{table}[H]
centering
caption{Title of the table}
label{my_label}
begin{tabular}{m{8.2cm} m{3.5} m{3.5cm}}
hline
multirow{2}{*}{Bulletpoint Title} & multicolumn{2}{c}{Merged columns 2-3}
\
& multicolumn{1}{c}{column 2} & multicolumn{1}{c}{column 3} \
hline
begin{itemize}
item Bulletpoint 1
item Bulletpoint 2
end{itemize}
& multicolumn{1}{c}{abc} & multicolumn{1}{c}{abc}\
hdashline
begin{itemize}
item Bulletpoint 3
item Bulletpoint 4
end{itemize}
& multicolumn{1}{c}{xyz} & multicolumn{1}{c}{xyz} \
hline
Total & multicolumn{1}{c}{Total c1} & multicolumn{1}{c}{Total c2}\
hline
& multicolumn{1}{p{3.5cm}}{} & multicolumn{1}{p{3.5cm}}{}\
end{tabular}
caption*{footnotesize This table shows *COMMENT*}
end{table}

end{document}


enter image description here










share|improve this question









New contributor




mrchrister is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • You are right, I added the preamble. I am sorry about that.

    – mrchrister
    7 hours ago











  • Commenting out the "tricky" row, I get this, isn't it what you want?

    – JouleV
    7 hours ago











  • Unfortunately not. When you comment out the "tricky" row, columns 2 and 3 adapt their size to the content of the cell and I don't want that. I want to be able to define the size of the cell (in centimeters). In my original table I have some formulas of different lengths which are longer than "abc". I want columns 2 and 3 to have the same width despite the contents have different lengths.

    – mrchrister
    6 hours ago






  • 1





    You have m{3.5} m{3.5cm}. Without testing I think changing to m{3.5cm} m{3.5cm} may solve the problem.

    – JouleV
    6 hours ago
















1















I have the following table and I am trying to give a specific length for column 1, 2 and 3 which stays fixed. I found a trick by adding an "invisible" row at the bottom (& multicolumn{1}{p{3.5cm}}{} & multicolumn{1}{p{3.5cm}}{}) but it doesn't seem a nice solution since I get obviously an empty row before my explanation of the table. Without that invisible row, although I put the sizes at the beginning of the table (begin{tabular}{m{8.2cm} m{3.5} m{3.5cm}}), the table just adapt to the content and it is not what I want.



Do you have any solution? It is the first time I do some table like that in Latex therefore I think the code is highly "inefficient and weird".



Thank you!



documentclass[11pt,a4paper]{article}
renewcommand{baselinestretch}{1.5}
renewcommandthesection{arabic{section}}
renewcommandthesubsection{thesection.arabic{subsection}}
usepackage{float}
usepackage{array}
usepackage{multirow}
usepackage{arydshln}
usepackage{geometry}
usepackage[font=small, justification=justified, format=plain]{caption}


begin{document}

begin{table}[H]
centering
caption{Title of the table}
label{my_label}
begin{tabular}{m{8.2cm} m{3.5} m{3.5cm}}
hline
multirow{2}{*}{Bulletpoint Title} & multicolumn{2}{c}{Merged columns 2-3}
\
& multicolumn{1}{c}{column 2} & multicolumn{1}{c}{column 3} \
hline
begin{itemize}
item Bulletpoint 1
item Bulletpoint 2
end{itemize}
& multicolumn{1}{c}{abc} & multicolumn{1}{c}{abc}\
hdashline
begin{itemize}
item Bulletpoint 3
item Bulletpoint 4
end{itemize}
& multicolumn{1}{c}{xyz} & multicolumn{1}{c}{xyz} \
hline
Total & multicolumn{1}{c}{Total c1} & multicolumn{1}{c}{Total c2}\
hline
& multicolumn{1}{p{3.5cm}}{} & multicolumn{1}{p{3.5cm}}{}\
end{tabular}
caption*{footnotesize This table shows *COMMENT*}
end{table}

end{document}


enter image description here










share|improve this question









New contributor




mrchrister is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • You are right, I added the preamble. I am sorry about that.

    – mrchrister
    7 hours ago











  • Commenting out the "tricky" row, I get this, isn't it what you want?

    – JouleV
    7 hours ago











  • Unfortunately not. When you comment out the "tricky" row, columns 2 and 3 adapt their size to the content of the cell and I don't want that. I want to be able to define the size of the cell (in centimeters). In my original table I have some formulas of different lengths which are longer than "abc". I want columns 2 and 3 to have the same width despite the contents have different lengths.

    – mrchrister
    6 hours ago






  • 1





    You have m{3.5} m{3.5cm}. Without testing I think changing to m{3.5cm} m{3.5cm} may solve the problem.

    – JouleV
    6 hours ago














1












1








1








I have the following table and I am trying to give a specific length for column 1, 2 and 3 which stays fixed. I found a trick by adding an "invisible" row at the bottom (& multicolumn{1}{p{3.5cm}}{} & multicolumn{1}{p{3.5cm}}{}) but it doesn't seem a nice solution since I get obviously an empty row before my explanation of the table. Without that invisible row, although I put the sizes at the beginning of the table (begin{tabular}{m{8.2cm} m{3.5} m{3.5cm}}), the table just adapt to the content and it is not what I want.



Do you have any solution? It is the first time I do some table like that in Latex therefore I think the code is highly "inefficient and weird".



Thank you!



documentclass[11pt,a4paper]{article}
renewcommand{baselinestretch}{1.5}
renewcommandthesection{arabic{section}}
renewcommandthesubsection{thesection.arabic{subsection}}
usepackage{float}
usepackage{array}
usepackage{multirow}
usepackage{arydshln}
usepackage{geometry}
usepackage[font=small, justification=justified, format=plain]{caption}


begin{document}

begin{table}[H]
centering
caption{Title of the table}
label{my_label}
begin{tabular}{m{8.2cm} m{3.5} m{3.5cm}}
hline
multirow{2}{*}{Bulletpoint Title} & multicolumn{2}{c}{Merged columns 2-3}
\
& multicolumn{1}{c}{column 2} & multicolumn{1}{c}{column 3} \
hline
begin{itemize}
item Bulletpoint 1
item Bulletpoint 2
end{itemize}
& multicolumn{1}{c}{abc} & multicolumn{1}{c}{abc}\
hdashline
begin{itemize}
item Bulletpoint 3
item Bulletpoint 4
end{itemize}
& multicolumn{1}{c}{xyz} & multicolumn{1}{c}{xyz} \
hline
Total & multicolumn{1}{c}{Total c1} & multicolumn{1}{c}{Total c2}\
hline
& multicolumn{1}{p{3.5cm}}{} & multicolumn{1}{p{3.5cm}}{}\
end{tabular}
caption*{footnotesize This table shows *COMMENT*}
end{table}

end{document}


enter image description here










share|improve this question









New contributor




mrchrister is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












I have the following table and I am trying to give a specific length for column 1, 2 and 3 which stays fixed. I found a trick by adding an "invisible" row at the bottom (& multicolumn{1}{p{3.5cm}}{} & multicolumn{1}{p{3.5cm}}{}) but it doesn't seem a nice solution since I get obviously an empty row before my explanation of the table. Without that invisible row, although I put the sizes at the beginning of the table (begin{tabular}{m{8.2cm} m{3.5} m{3.5cm}}), the table just adapt to the content and it is not what I want.



Do you have any solution? It is the first time I do some table like that in Latex therefore I think the code is highly "inefficient and weird".



Thank you!



documentclass[11pt,a4paper]{article}
renewcommand{baselinestretch}{1.5}
renewcommandthesection{arabic{section}}
renewcommandthesubsection{thesection.arabic{subsection}}
usepackage{float}
usepackage{array}
usepackage{multirow}
usepackage{arydshln}
usepackage{geometry}
usepackage[font=small, justification=justified, format=plain]{caption}


begin{document}

begin{table}[H]
centering
caption{Title of the table}
label{my_label}
begin{tabular}{m{8.2cm} m{3.5} m{3.5cm}}
hline
multirow{2}{*}{Bulletpoint Title} & multicolumn{2}{c}{Merged columns 2-3}
\
& multicolumn{1}{c}{column 2} & multicolumn{1}{c}{column 3} \
hline
begin{itemize}
item Bulletpoint 1
item Bulletpoint 2
end{itemize}
& multicolumn{1}{c}{abc} & multicolumn{1}{c}{abc}\
hdashline
begin{itemize}
item Bulletpoint 3
item Bulletpoint 4
end{itemize}
& multicolumn{1}{c}{xyz} & multicolumn{1}{c}{xyz} \
hline
Total & multicolumn{1}{c}{Total c1} & multicolumn{1}{c}{Total c2}\
hline
& multicolumn{1}{p{3.5cm}}{} & multicolumn{1}{p{3.5cm}}{}\
end{tabular}
caption*{footnotesize This table shows *COMMENT*}
end{table}

end{document}


enter image description here







multicol size






share|improve this question









New contributor




mrchrister is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




mrchrister is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 7 hours ago







mrchrister













New contributor




mrchrister is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 7 hours ago









mrchristermrchrister

62




62




New contributor




mrchrister is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





mrchrister is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






mrchrister is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.













  • You are right, I added the preamble. I am sorry about that.

    – mrchrister
    7 hours ago











  • Commenting out the "tricky" row, I get this, isn't it what you want?

    – JouleV
    7 hours ago











  • Unfortunately not. When you comment out the "tricky" row, columns 2 and 3 adapt their size to the content of the cell and I don't want that. I want to be able to define the size of the cell (in centimeters). In my original table I have some formulas of different lengths which are longer than "abc". I want columns 2 and 3 to have the same width despite the contents have different lengths.

    – mrchrister
    6 hours ago






  • 1





    You have m{3.5} m{3.5cm}. Without testing I think changing to m{3.5cm} m{3.5cm} may solve the problem.

    – JouleV
    6 hours ago



















  • You are right, I added the preamble. I am sorry about that.

    – mrchrister
    7 hours ago











  • Commenting out the "tricky" row, I get this, isn't it what you want?

    – JouleV
    7 hours ago











  • Unfortunately not. When you comment out the "tricky" row, columns 2 and 3 adapt their size to the content of the cell and I don't want that. I want to be able to define the size of the cell (in centimeters). In my original table I have some formulas of different lengths which are longer than "abc". I want columns 2 and 3 to have the same width despite the contents have different lengths.

    – mrchrister
    6 hours ago






  • 1





    You have m{3.5} m{3.5cm}. Without testing I think changing to m{3.5cm} m{3.5cm} may solve the problem.

    – JouleV
    6 hours ago

















You are right, I added the preamble. I am sorry about that.

– mrchrister
7 hours ago





You are right, I added the preamble. I am sorry about that.

– mrchrister
7 hours ago













Commenting out the "tricky" row, I get this, isn't it what you want?

– JouleV
7 hours ago





Commenting out the "tricky" row, I get this, isn't it what you want?

– JouleV
7 hours ago













Unfortunately not. When you comment out the "tricky" row, columns 2 and 3 adapt their size to the content of the cell and I don't want that. I want to be able to define the size of the cell (in centimeters). In my original table I have some formulas of different lengths which are longer than "abc". I want columns 2 and 3 to have the same width despite the contents have different lengths.

– mrchrister
6 hours ago





Unfortunately not. When you comment out the "tricky" row, columns 2 and 3 adapt their size to the content of the cell and I don't want that. I want to be able to define the size of the cell (in centimeters). In my original table I have some formulas of different lengths which are longer than "abc". I want columns 2 and 3 to have the same width despite the contents have different lengths.

– mrchrister
6 hours ago




1




1





You have m{3.5} m{3.5cm}. Without testing I think changing to m{3.5cm} m{3.5cm} may solve the problem.

– JouleV
6 hours ago





You have m{3.5} m{3.5cm}. Without testing I think changing to m{3.5cm} m{3.5cm} may solve the problem.

– JouleV
6 hours ago










1 Answer
1






active

oldest

votes


















1














documentclass[11pt,a4paper]{article}
renewcommand{baselinestretch}{1.5}
renewcommandthesection{arabic{section}}
renewcommandthesubsection{thesection.arabic{subsection}}
%usepackage{float}
usepackage{array, multirow}
usepackage{arydshln}
usepackage{geometry}
usepackage[font=small, justification=justified, format=plain]{caption}
usepackage{enumitem} % new


begin{document}

begin{table}[htb]
setlist[itemize]{leftmargin=*, % new
after=vspace{-0.6baselineskip}
}
centering
caption{Title of the table}
label{my_label}
begin{tabular}{m{8.2cm} *{2}{>{centeringarraybackslash}m{3.5cm}}}
hline
multirow{2}{*}{Bulletpoint Title}
& multicolumn{2}{c}{Merged columns 2-3} \
& column 2 & column 3 \
hline
begin{itemize}
item Bulletpoint 1
item Bulletpoint 2
end{itemize}
& abc & abc \
hdashline
begin{itemize}
item Bulletpoint 3
item Bulletpoint 4
end{itemize}
& xyz & xyz \
hline
Total & Total c1 & Total c2 \
hline
end{tabular}
caption*{footnotesize This table shows *COMMENT*}
end{table}

end{document}


gives:



enter image description here



in above MWE i removed all unnecessary multicolumn{1}{c}{...}'s and empty rows, redefined column types that column contents are centered and for lists use the enumitem package.






share|improve this answer


























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "85"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });






    mrchrister is a new contributor. Be nice, and check out our Code of Conduct.










    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f483902%2fsize-of-cells-in-multirow-and-multicolumn-environment%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    documentclass[11pt,a4paper]{article}
    renewcommand{baselinestretch}{1.5}
    renewcommandthesection{arabic{section}}
    renewcommandthesubsection{thesection.arabic{subsection}}
    %usepackage{float}
    usepackage{array, multirow}
    usepackage{arydshln}
    usepackage{geometry}
    usepackage[font=small, justification=justified, format=plain]{caption}
    usepackage{enumitem} % new


    begin{document}

    begin{table}[htb]
    setlist[itemize]{leftmargin=*, % new
    after=vspace{-0.6baselineskip}
    }
    centering
    caption{Title of the table}
    label{my_label}
    begin{tabular}{m{8.2cm} *{2}{>{centeringarraybackslash}m{3.5cm}}}
    hline
    multirow{2}{*}{Bulletpoint Title}
    & multicolumn{2}{c}{Merged columns 2-3} \
    & column 2 & column 3 \
    hline
    begin{itemize}
    item Bulletpoint 1
    item Bulletpoint 2
    end{itemize}
    & abc & abc \
    hdashline
    begin{itemize}
    item Bulletpoint 3
    item Bulletpoint 4
    end{itemize}
    & xyz & xyz \
    hline
    Total & Total c1 & Total c2 \
    hline
    end{tabular}
    caption*{footnotesize This table shows *COMMENT*}
    end{table}

    end{document}


    gives:



    enter image description here



    in above MWE i removed all unnecessary multicolumn{1}{c}{...}'s and empty rows, redefined column types that column contents are centered and for lists use the enumitem package.






    share|improve this answer






























      1














      documentclass[11pt,a4paper]{article}
      renewcommand{baselinestretch}{1.5}
      renewcommandthesection{arabic{section}}
      renewcommandthesubsection{thesection.arabic{subsection}}
      %usepackage{float}
      usepackage{array, multirow}
      usepackage{arydshln}
      usepackage{geometry}
      usepackage[font=small, justification=justified, format=plain]{caption}
      usepackage{enumitem} % new


      begin{document}

      begin{table}[htb]
      setlist[itemize]{leftmargin=*, % new
      after=vspace{-0.6baselineskip}
      }
      centering
      caption{Title of the table}
      label{my_label}
      begin{tabular}{m{8.2cm} *{2}{>{centeringarraybackslash}m{3.5cm}}}
      hline
      multirow{2}{*}{Bulletpoint Title}
      & multicolumn{2}{c}{Merged columns 2-3} \
      & column 2 & column 3 \
      hline
      begin{itemize}
      item Bulletpoint 1
      item Bulletpoint 2
      end{itemize}
      & abc & abc \
      hdashline
      begin{itemize}
      item Bulletpoint 3
      item Bulletpoint 4
      end{itemize}
      & xyz & xyz \
      hline
      Total & Total c1 & Total c2 \
      hline
      end{tabular}
      caption*{footnotesize This table shows *COMMENT*}
      end{table}

      end{document}


      gives:



      enter image description here



      in above MWE i removed all unnecessary multicolumn{1}{c}{...}'s and empty rows, redefined column types that column contents are centered and for lists use the enumitem package.






      share|improve this answer




























        1












        1








        1







        documentclass[11pt,a4paper]{article}
        renewcommand{baselinestretch}{1.5}
        renewcommandthesection{arabic{section}}
        renewcommandthesubsection{thesection.arabic{subsection}}
        %usepackage{float}
        usepackage{array, multirow}
        usepackage{arydshln}
        usepackage{geometry}
        usepackage[font=small, justification=justified, format=plain]{caption}
        usepackage{enumitem} % new


        begin{document}

        begin{table}[htb]
        setlist[itemize]{leftmargin=*, % new
        after=vspace{-0.6baselineskip}
        }
        centering
        caption{Title of the table}
        label{my_label}
        begin{tabular}{m{8.2cm} *{2}{>{centeringarraybackslash}m{3.5cm}}}
        hline
        multirow{2}{*}{Bulletpoint Title}
        & multicolumn{2}{c}{Merged columns 2-3} \
        & column 2 & column 3 \
        hline
        begin{itemize}
        item Bulletpoint 1
        item Bulletpoint 2
        end{itemize}
        & abc & abc \
        hdashline
        begin{itemize}
        item Bulletpoint 3
        item Bulletpoint 4
        end{itemize}
        & xyz & xyz \
        hline
        Total & Total c1 & Total c2 \
        hline
        end{tabular}
        caption*{footnotesize This table shows *COMMENT*}
        end{table}

        end{document}


        gives:



        enter image description here



        in above MWE i removed all unnecessary multicolumn{1}{c}{...}'s and empty rows, redefined column types that column contents are centered and for lists use the enumitem package.






        share|improve this answer















        documentclass[11pt,a4paper]{article}
        renewcommand{baselinestretch}{1.5}
        renewcommandthesection{arabic{section}}
        renewcommandthesubsection{thesection.arabic{subsection}}
        %usepackage{float}
        usepackage{array, multirow}
        usepackage{arydshln}
        usepackage{geometry}
        usepackage[font=small, justification=justified, format=plain]{caption}
        usepackage{enumitem} % new


        begin{document}

        begin{table}[htb]
        setlist[itemize]{leftmargin=*, % new
        after=vspace{-0.6baselineskip}
        }
        centering
        caption{Title of the table}
        label{my_label}
        begin{tabular}{m{8.2cm} *{2}{>{centeringarraybackslash}m{3.5cm}}}
        hline
        multirow{2}{*}{Bulletpoint Title}
        & multicolumn{2}{c}{Merged columns 2-3} \
        & column 2 & column 3 \
        hline
        begin{itemize}
        item Bulletpoint 1
        item Bulletpoint 2
        end{itemize}
        & abc & abc \
        hdashline
        begin{itemize}
        item Bulletpoint 3
        item Bulletpoint 4
        end{itemize}
        & xyz & xyz \
        hline
        Total & Total c1 & Total c2 \
        hline
        end{tabular}
        caption*{footnotesize This table shows *COMMENT*}
        end{table}

        end{document}


        gives:



        enter image description here



        in above MWE i removed all unnecessary multicolumn{1}{c}{...}'s and empty rows, redefined column types that column contents are centered and for lists use the enumitem package.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 6 hours ago

























        answered 6 hours ago









        ZarkoZarko

        129k868169




        129k868169






















            mrchrister is a new contributor. Be nice, and check out our Code of Conduct.










            draft saved

            draft discarded


















            mrchrister is a new contributor. Be nice, and check out our Code of Conduct.













            mrchrister is a new contributor. Be nice, and check out our Code of Conduct.












            mrchrister is a new contributor. Be nice, and check out our Code of Conduct.
















            Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f483902%2fsize-of-cells-in-multirow-and-multicolumn-environment%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown