How can I solve this problem with latex table?












5















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




















  • 2





    Welcome to TeX.SE! Write cline{2-3} instead of cline{2-2}.

    – CarLaTeX
    Dec 8 '18 at 10:43













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

    – Josemi
    Dec 8 '18 at 10:45











  • 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
    Dec 8 '18 at 10:47











  • You're welcome! The syntax is cline{StartColumn-EndColumn}.

    – CarLaTeX
    Dec 8 '18 at 10:55











  • 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
    Dec 8 '18 at 10:59
















5















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




















  • 2





    Welcome to TeX.SE! Write cline{2-3} instead of cline{2-2}.

    – CarLaTeX
    Dec 8 '18 at 10:43













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

    – Josemi
    Dec 8 '18 at 10:45











  • 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
    Dec 8 '18 at 10:47











  • You're welcome! The syntax is cline{StartColumn-EndColumn}.

    – CarLaTeX
    Dec 8 '18 at 10:55











  • 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
    Dec 8 '18 at 10:59














5












5








5








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
















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















share|improve this question













share|improve this question




share|improve this question








edited Dec 8 '18 at 10:43









CarLaTeX

30.8k449129




30.8k449129










asked Dec 8 '18 at 10:38









Josemi Josemi

794




794








  • 2





    Welcome to TeX.SE! Write cline{2-3} instead of cline{2-2}.

    – CarLaTeX
    Dec 8 '18 at 10:43













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

    – Josemi
    Dec 8 '18 at 10:45











  • 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
    Dec 8 '18 at 10:47











  • You're welcome! The syntax is cline{StartColumn-EndColumn}.

    – CarLaTeX
    Dec 8 '18 at 10:55











  • 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
    Dec 8 '18 at 10:59














  • 2





    Welcome to TeX.SE! Write cline{2-3} instead of cline{2-2}.

    – CarLaTeX
    Dec 8 '18 at 10:43













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

    – Josemi
    Dec 8 '18 at 10:45











  • 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
    Dec 8 '18 at 10:47











  • You're welcome! The syntax is cline{StartColumn-EndColumn}.

    – CarLaTeX
    Dec 8 '18 at 10:55











  • 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
    Dec 8 '18 at 10:59








2




2





Welcome to TeX.SE! Write cline{2-3} instead of cline{2-2}.

– CarLaTeX
Dec 8 '18 at 10:43







Welcome to TeX.SE! Write cline{2-3} instead of cline{2-2}.

– CarLaTeX
Dec 8 '18 at 10:43















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

– Josemi
Dec 8 '18 at 10:45





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

– Josemi
Dec 8 '18 at 10:45













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
Dec 8 '18 at 10:47





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
Dec 8 '18 at 10:47













You're welcome! The syntax is cline{StartColumn-EndColumn}.

– CarLaTeX
Dec 8 '18 at 10:55





You're welcome! The syntax is cline{StartColumn-EndColumn}.

– CarLaTeX
Dec 8 '18 at 10:55













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
Dec 8 '18 at 10:59





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
Dec 8 '18 at 10:59










1 Answer
1






active

oldest

votes


















7














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


    }
    });














    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









    7














    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




























      7














      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


























        7












        7








        7







        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 Dec 8 '18 at 11:04









        Andrew SwannAndrew Swann

        77k9129326




        77k9129326






























            draft saved

            draft discarded




















































            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%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

            Probability when a professor distributes a quiz and homework assignment to a class of n students.

            Aardman Animations

            Are they similar matrix