How can I solve this problem with latex table?











up vote
5
down vote

favorite












I want to make a table like this:



enter image description here



So I tried with this Latex code:



begin{table}[h!]
begin{center}
begin{tabular}{|l|c|c|}
hline multirow{2}{3cm}{Filter Type} &
multicolumn{2}{|c|}{Ideal impulse response $h_D(n)$} \
cline{2-2} & $h_D(n), ; nneq 0$ & $h_D(0)$ \ hline
end{tabular}
end{center}
end{table}


But I get this table instead:



enter image description here



I don't know how to fix my problem, so I appreciate if someone could help me.










share|improve this question









New contributor




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
















  • 2




    Welcome to TeX.SE! Write cline{2-3} instead of cline{2-2}.
    – CarLaTeX
    17 hours ago












  • Wow, I didn't know it was so simple, maybe I should get more information about de cline command. Thank you so much!
    – Josemi
    17 hours ago










  • Also replace both the c columns with >{centeringarraybackslash}p{2.5cm} columns in order to have space too (length 2.5 cm is just a guess... test it)
    – koleygr
    17 hours ago










  • You're welcome! The syntax is cline{StartColumn-EndColumn}.
    – CarLaTeX
    17 hours ago










  • Welcome to TeX - LaTeX! In general it is better post a complete minimal document that we can compile, rather than a code snippet, cf. minimal working example (MWE)
    – Andrew Swann
    17 hours ago















up vote
5
down vote

favorite












I want to make a table like this:



enter image description here



So I tried with this Latex code:



begin{table}[h!]
begin{center}
begin{tabular}{|l|c|c|}
hline multirow{2}{3cm}{Filter Type} &
multicolumn{2}{|c|}{Ideal impulse response $h_D(n)$} \
cline{2-2} & $h_D(n), ; nneq 0$ & $h_D(0)$ \ hline
end{tabular}
end{center}
end{table}


But I get this table instead:



enter image description here



I don't know how to fix my problem, so I appreciate if someone could help me.










share|improve this question









New contributor




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
















  • 2




    Welcome to TeX.SE! Write cline{2-3} instead of cline{2-2}.
    – CarLaTeX
    17 hours ago












  • Wow, I didn't know it was so simple, maybe I should get more information about de cline command. Thank you so much!
    – Josemi
    17 hours ago










  • Also replace both the c columns with >{centeringarraybackslash}p{2.5cm} columns in order to have space too (length 2.5 cm is just a guess... test it)
    – koleygr
    17 hours ago










  • You're welcome! The syntax is cline{StartColumn-EndColumn}.
    – CarLaTeX
    17 hours ago










  • Welcome to TeX - LaTeX! In general it is better post a complete minimal document that we can compile, rather than a code snippet, cf. minimal working example (MWE)
    – Andrew Swann
    17 hours ago













up vote
5
down vote

favorite









up vote
5
down vote

favorite











I want to make a table like this:



enter image description here



So I tried with this Latex code:



begin{table}[h!]
begin{center}
begin{tabular}{|l|c|c|}
hline multirow{2}{3cm}{Filter Type} &
multicolumn{2}{|c|}{Ideal impulse response $h_D(n)$} \
cline{2-2} & $h_D(n), ; nneq 0$ & $h_D(0)$ \ hline
end{tabular}
end{center}
end{table}


But I get this table instead:



enter image description here



I don't know how to fix my problem, so I appreciate if someone could help me.










share|improve this question









New contributor




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











I want to make a table like this:



enter image description here



So I tried with this Latex code:



begin{table}[h!]
begin{center}
begin{tabular}{|l|c|c|}
hline multirow{2}{3cm}{Filter Type} &
multicolumn{2}{|c|}{Ideal impulse response $h_D(n)$} \
cline{2-2} & $h_D(n), ; nneq 0$ & $h_D(0)$ \ hline
end{tabular}
end{center}
end{table}


But I get this table instead:



enter image description here



I don't know how to fix my problem, so I appreciate if someone could help me.







tables






share|improve this question









New contributor




Josemi 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




Josemi 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 17 hours ago









CarLaTeX

28.3k446122




28.3k446122






New contributor




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









asked 17 hours ago









Josemi

283




283




New contributor




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





New contributor





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






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








  • 2




    Welcome to TeX.SE! Write cline{2-3} instead of cline{2-2}.
    – CarLaTeX
    17 hours ago












  • Wow, I didn't know it was so simple, maybe I should get more information about de cline command. Thank you so much!
    – Josemi
    17 hours ago










  • Also replace both the c columns with >{centeringarraybackslash}p{2.5cm} columns in order to have space too (length 2.5 cm is just a guess... test it)
    – koleygr
    17 hours ago










  • You're welcome! The syntax is cline{StartColumn-EndColumn}.
    – CarLaTeX
    17 hours ago










  • Welcome to TeX - LaTeX! In general it is better post a complete minimal document that we can compile, rather than a code snippet, cf. minimal working example (MWE)
    – Andrew Swann
    17 hours ago














  • 2




    Welcome to TeX.SE! Write cline{2-3} instead of cline{2-2}.
    – CarLaTeX
    17 hours ago












  • Wow, I didn't know it was so simple, maybe I should get more information about de cline command. Thank you so much!
    – Josemi
    17 hours ago










  • Also replace both the c columns with >{centeringarraybackslash}p{2.5cm} columns in order to have space too (length 2.5 cm is just a guess... test it)
    – koleygr
    17 hours ago










  • You're welcome! The syntax is cline{StartColumn-EndColumn}.
    – CarLaTeX
    17 hours ago










  • Welcome to TeX - LaTeX! In general it is better post a complete minimal document that we can compile, rather than a code snippet, cf. minimal working example (MWE)
    – Andrew Swann
    17 hours ago








2




2




Welcome to TeX.SE! Write cline{2-3} instead of cline{2-2}.
– CarLaTeX
17 hours ago






Welcome to TeX.SE! Write cline{2-3} instead of cline{2-2}.
– CarLaTeX
17 hours ago














Wow, I didn't know it was so simple, maybe I should get more information about de cline command. Thank you so much!
– Josemi
17 hours ago




Wow, I didn't know it was so simple, maybe I should get more information about de cline command. Thank you so much!
– Josemi
17 hours ago












Also replace both the c columns with >{centeringarraybackslash}p{2.5cm} columns in order to have space too (length 2.5 cm is just a guess... test it)
– koleygr
17 hours ago




Also replace both the c columns with >{centeringarraybackslash}p{2.5cm} columns in order to have space too (length 2.5 cm is just a guess... test it)
– koleygr
17 hours ago












You're welcome! The syntax is cline{StartColumn-EndColumn}.
– CarLaTeX
17 hours ago




You're welcome! The syntax is cline{StartColumn-EndColumn}.
– CarLaTeX
17 hours ago












Welcome to TeX - LaTeX! In general it is better post a complete minimal document that we can compile, rather than a code snippet, cf. minimal working example (MWE)
– Andrew Swann
17 hours ago




Welcome to TeX - LaTeX! In general it is better post a complete minimal document that we can compile, rather than a code snippet, cf. minimal working example (MWE)
– Andrew Swann
17 hours ago










1 Answer
1






active

oldest

votes

















up vote
6
down vote



accepted










A minimal modification to your code to get the vertical placing of "Filter Type" and the requested rule is:



First sample



documentclass{article}

begin{document}
begin{table}[h!]
begin{center}
begin{tabular}{|l|c|c|}
hline Filter Type
& multicolumn{2}{|c|}{Ideal impulse response $h_D(n)$} \
cline{2-3} & $h_D(n), ; nneq 0$ & $h_D(0)$ \ hline
end{tabular}
end{center}
end{table}
end{document}


However, you should consider whether you need all these vertical rules. I guess this is just heading material for a table, in which case I would suggest:



Second sample



documentclass{article}

usepackage{booktabs}

begin{document}

begin{center}
begin{tabular}{l*{2}{c}}
toprule
Filter Type
& multicolumn{2}{c}{Ideal impulse response $h_D(n)$} \
& $nneq 0$ & $n=0$ \
midrule
X&$2$&$-1$\
Y&$3$&$2$ \
bottomrule
end{tabular}
end{center}

end{document}


Note that a table environment is not necessary, particularly if you want placement at a particular point on the page. If you need a caption, then the captionof command from the caption package can be used.



See the documentation of the booktabs package for more advice on good style for tables.






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',
    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
    });


    }
    });






    Josemi 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%2f463788%2fhow-can-i-solve-this-problem-with-latex-table%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








    up vote
    6
    down vote



    accepted










    A minimal modification to your code to get the vertical placing of "Filter Type" and the requested rule is:



    First sample



    documentclass{article}

    begin{document}
    begin{table}[h!]
    begin{center}
    begin{tabular}{|l|c|c|}
    hline Filter Type
    & multicolumn{2}{|c|}{Ideal impulse response $h_D(n)$} \
    cline{2-3} & $h_D(n), ; nneq 0$ & $h_D(0)$ \ hline
    end{tabular}
    end{center}
    end{table}
    end{document}


    However, you should consider whether you need all these vertical rules. I guess this is just heading material for a table, in which case I would suggest:



    Second sample



    documentclass{article}

    usepackage{booktabs}

    begin{document}

    begin{center}
    begin{tabular}{l*{2}{c}}
    toprule
    Filter Type
    & multicolumn{2}{c}{Ideal impulse response $h_D(n)$} \
    & $nneq 0$ & $n=0$ \
    midrule
    X&$2$&$-1$\
    Y&$3$&$2$ \
    bottomrule
    end{tabular}
    end{center}

    end{document}


    Note that a table environment is not necessary, particularly if you want placement at a particular point on the page. If you need a caption, then the captionof command from the caption package can be used.



    See the documentation of the booktabs package for more advice on good style for tables.






    share|improve this answer

























      up vote
      6
      down vote



      accepted










      A minimal modification to your code to get the vertical placing of "Filter Type" and the requested rule is:



      First sample



      documentclass{article}

      begin{document}
      begin{table}[h!]
      begin{center}
      begin{tabular}{|l|c|c|}
      hline Filter Type
      & multicolumn{2}{|c|}{Ideal impulse response $h_D(n)$} \
      cline{2-3} & $h_D(n), ; nneq 0$ & $h_D(0)$ \ hline
      end{tabular}
      end{center}
      end{table}
      end{document}


      However, you should consider whether you need all these vertical rules. I guess this is just heading material for a table, in which case I would suggest:



      Second sample



      documentclass{article}

      usepackage{booktabs}

      begin{document}

      begin{center}
      begin{tabular}{l*{2}{c}}
      toprule
      Filter Type
      & multicolumn{2}{c}{Ideal impulse response $h_D(n)$} \
      & $nneq 0$ & $n=0$ \
      midrule
      X&$2$&$-1$\
      Y&$3$&$2$ \
      bottomrule
      end{tabular}
      end{center}

      end{document}


      Note that a table environment is not necessary, particularly if you want placement at a particular point on the page. If you need a caption, then the captionof command from the caption package can be used.



      See the documentation of the booktabs package for more advice on good style for tables.






      share|improve this answer























        up vote
        6
        down vote



        accepted







        up vote
        6
        down vote



        accepted






        A minimal modification to your code to get the vertical placing of "Filter Type" and the requested rule is:



        First sample



        documentclass{article}

        begin{document}
        begin{table}[h!]
        begin{center}
        begin{tabular}{|l|c|c|}
        hline Filter Type
        & multicolumn{2}{|c|}{Ideal impulse response $h_D(n)$} \
        cline{2-3} & $h_D(n), ; nneq 0$ & $h_D(0)$ \ hline
        end{tabular}
        end{center}
        end{table}
        end{document}


        However, you should consider whether you need all these vertical rules. I guess this is just heading material for a table, in which case I would suggest:



        Second sample



        documentclass{article}

        usepackage{booktabs}

        begin{document}

        begin{center}
        begin{tabular}{l*{2}{c}}
        toprule
        Filter Type
        & multicolumn{2}{c}{Ideal impulse response $h_D(n)$} \
        & $nneq 0$ & $n=0$ \
        midrule
        X&$2$&$-1$\
        Y&$3$&$2$ \
        bottomrule
        end{tabular}
        end{center}

        end{document}


        Note that a table environment is not necessary, particularly if you want placement at a particular point on the page. If you need a caption, then the captionof command from the caption package can be used.



        See the documentation of the booktabs package for more advice on good style for tables.






        share|improve this answer












        A minimal modification to your code to get the vertical placing of "Filter Type" and the requested rule is:



        First sample



        documentclass{article}

        begin{document}
        begin{table}[h!]
        begin{center}
        begin{tabular}{|l|c|c|}
        hline Filter Type
        & multicolumn{2}{|c|}{Ideal impulse response $h_D(n)$} \
        cline{2-3} & $h_D(n), ; nneq 0$ & $h_D(0)$ \ hline
        end{tabular}
        end{center}
        end{table}
        end{document}


        However, you should consider whether you need all these vertical rules. I guess this is just heading material for a table, in which case I would suggest:



        Second sample



        documentclass{article}

        usepackage{booktabs}

        begin{document}

        begin{center}
        begin{tabular}{l*{2}{c}}
        toprule
        Filter Type
        & multicolumn{2}{c}{Ideal impulse response $h_D(n)$} \
        & $nneq 0$ & $n=0$ \
        midrule
        X&$2$&$-1$\
        Y&$3$&$2$ \
        bottomrule
        end{tabular}
        end{center}

        end{document}


        Note that a table environment is not necessary, particularly if you want placement at a particular point on the page. If you need a caption, then the captionof command from the caption package can be used.



        See the documentation of the booktabs package for more advice on good style for tables.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 17 hours ago









        Andrew Swann

        76.4k9128324




        76.4k9128324






















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










            draft saved

            draft discarded


















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













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












            Josemi 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.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • 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%2f463788%2fhow-can-i-solve-this-problem-with-latex-table%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







            Popular posts from this blog

            Morgemoulin

            Scott Moir

            Souastre