Center a title inside a table












4














my problem is about this code:



documentclass{article}
usepackage[utf8]{inputenc}
usepackage[spanish]{babel}
usepackage{array}
newcolumntype{L}{>{raggedrightarraybackslash}p{.4linewidth}}
renewcommand{arraystretch}{1.2}

begin{document}

title{empty}
author{empty}
maketitle

begin{table}[h!]
begin{center}
begin{tabular}{L|L}
textbf{P4/1} newline
sudo ifconfig serviciosB downnewline
sudo ifconfig serviciosA newline 172.24.1.1/24 newline
sudo route add -net 172.24.2.0/24 gw 172.24.1.222
& textbf{P4/3} newline
sudo ifconfig serviciosA down
newline
sudo ifconfig serviciosB newline 172.24.2.1/24 newline
sudo route add -net 172.24.1.0/24 gw 172.24.2.222 \
hline
textbf{P4/2} newline
sudo ifconfig serviciosB down newline
sudo ifconfig serviciosA newline 172.24.1.2/24 newline
sudo route add -net 172.24.2.0/24 gw 172.24.1.222 & textbf{P4/4} newline
sudo ifconfig serviciosA down newline
sudo ifconfig serviciosB newline 172.24.2.2/24 newline
sudo route add -net 172.24.1.0/24 gw 172.24.2.222 \
end{tabular}
end{center}
end{table}

end{document}


The issue is that I'd like to center the title in bold (P4/1,P4/2...), but if I include for example begin{center} textbf{P4/1} end{center} inside the table, there's a lot of space between the beginning of the table and the title.



I hope someone can help me. Thanks for your responses.










share|improve this question



























    4














    my problem is about this code:



    documentclass{article}
    usepackage[utf8]{inputenc}
    usepackage[spanish]{babel}
    usepackage{array}
    newcolumntype{L}{>{raggedrightarraybackslash}p{.4linewidth}}
    renewcommand{arraystretch}{1.2}

    begin{document}

    title{empty}
    author{empty}
    maketitle

    begin{table}[h!]
    begin{center}
    begin{tabular}{L|L}
    textbf{P4/1} newline
    sudo ifconfig serviciosB downnewline
    sudo ifconfig serviciosA newline 172.24.1.1/24 newline
    sudo route add -net 172.24.2.0/24 gw 172.24.1.222
    & textbf{P4/3} newline
    sudo ifconfig serviciosA down
    newline
    sudo ifconfig serviciosB newline 172.24.2.1/24 newline
    sudo route add -net 172.24.1.0/24 gw 172.24.2.222 \
    hline
    textbf{P4/2} newline
    sudo ifconfig serviciosB down newline
    sudo ifconfig serviciosA newline 172.24.1.2/24 newline
    sudo route add -net 172.24.2.0/24 gw 172.24.1.222 & textbf{P4/4} newline
    sudo ifconfig serviciosA down newline
    sudo ifconfig serviciosB newline 172.24.2.2/24 newline
    sudo route add -net 172.24.1.0/24 gw 172.24.2.222 \
    end{tabular}
    end{center}
    end{table}

    end{document}


    The issue is that I'd like to center the title in bold (P4/1,P4/2...), but if I include for example begin{center} textbf{P4/1} end{center} inside the table, there's a lot of space between the beginning of the table and the title.



    I hope someone can help me. Thanks for your responses.










    share|improve this question

























      4












      4








      4







      my problem is about this code:



      documentclass{article}
      usepackage[utf8]{inputenc}
      usepackage[spanish]{babel}
      usepackage{array}
      newcolumntype{L}{>{raggedrightarraybackslash}p{.4linewidth}}
      renewcommand{arraystretch}{1.2}

      begin{document}

      title{empty}
      author{empty}
      maketitle

      begin{table}[h!]
      begin{center}
      begin{tabular}{L|L}
      textbf{P4/1} newline
      sudo ifconfig serviciosB downnewline
      sudo ifconfig serviciosA newline 172.24.1.1/24 newline
      sudo route add -net 172.24.2.0/24 gw 172.24.1.222
      & textbf{P4/3} newline
      sudo ifconfig serviciosA down
      newline
      sudo ifconfig serviciosB newline 172.24.2.1/24 newline
      sudo route add -net 172.24.1.0/24 gw 172.24.2.222 \
      hline
      textbf{P4/2} newline
      sudo ifconfig serviciosB down newline
      sudo ifconfig serviciosA newline 172.24.1.2/24 newline
      sudo route add -net 172.24.2.0/24 gw 172.24.1.222 & textbf{P4/4} newline
      sudo ifconfig serviciosA down newline
      sudo ifconfig serviciosB newline 172.24.2.2/24 newline
      sudo route add -net 172.24.1.0/24 gw 172.24.2.222 \
      end{tabular}
      end{center}
      end{table}

      end{document}


      The issue is that I'd like to center the title in bold (P4/1,P4/2...), but if I include for example begin{center} textbf{P4/1} end{center} inside the table, there's a lot of space between the beginning of the table and the title.



      I hope someone can help me. Thanks for your responses.










      share|improve this question













      my problem is about this code:



      documentclass{article}
      usepackage[utf8]{inputenc}
      usepackage[spanish]{babel}
      usepackage{array}
      newcolumntype{L}{>{raggedrightarraybackslash}p{.4linewidth}}
      renewcommand{arraystretch}{1.2}

      begin{document}

      title{empty}
      author{empty}
      maketitle

      begin{table}[h!]
      begin{center}
      begin{tabular}{L|L}
      textbf{P4/1} newline
      sudo ifconfig serviciosB downnewline
      sudo ifconfig serviciosA newline 172.24.1.1/24 newline
      sudo route add -net 172.24.2.0/24 gw 172.24.1.222
      & textbf{P4/3} newline
      sudo ifconfig serviciosA down
      newline
      sudo ifconfig serviciosB newline 172.24.2.1/24 newline
      sudo route add -net 172.24.1.0/24 gw 172.24.2.222 \
      hline
      textbf{P4/2} newline
      sudo ifconfig serviciosB down newline
      sudo ifconfig serviciosA newline 172.24.1.2/24 newline
      sudo route add -net 172.24.2.0/24 gw 172.24.1.222 & textbf{P4/4} newline
      sudo ifconfig serviciosA down newline
      sudo ifconfig serviciosB newline 172.24.2.2/24 newline
      sudo route add -net 172.24.1.0/24 gw 172.24.2.222 \
      end{tabular}
      end{center}
      end{table}

      end{document}


      The issue is that I'd like to center the title in bold (P4/1,P4/2...), but if I include for example begin{center} textbf{P4/1} end{center} inside the table, there's a lot of space between the beginning of the table and the title.



      I hope someone can help me. Thanks for your responses.







      tables spacing






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 22 '18 at 13:02









      Josemi

      794




      794






















          2 Answers
          2






          active

          oldest

          votes


















          4














          You can put the titles in their own row and use multicolumn{1}{c}{bold title}. Other than that, I defined a titlehead command which does the job:



          documentclass{article}
          usepackage[utf8]{inputenc}
          usepackage[spanish]{babel}
          usepackage{array}
          newcolumntype{L}{>{raggedrightarraybackslash}p{.4linewidth}}
          renewcommand{arraystretch}{1.2}%
          newcommand{titlehead}[1]{hfilltextbf{#1}hfillnull}%

          begin{document}

          title{empty}
          author{empty}
          maketitle

          begin{table}[h!]
          centering
          setlength{extrarowheight}{2pt}
          begin{tabular}{L|L}
          titlehead{P4/1} newline
          sudo ifconfig serviciosB downnewline
          sudo ifconfig serviciosA newline 172.24.1.1/24 newline
          sudo route add -net 172.24.2.0/24 gw 172.24.1.222
          & titlehead{textbf{P4/3}} newline
          sudo ifconfig serviciosA down
          newline
          sudo ifconfig serviciosB newline 172.24.2.1/24 newline
          sudo route add -net 172.24.1.0/24 gw 172.24.2.222 \
          hline
          titlehead{textbf{P4/2}} newline
          sudo ifconfig serviciosB down newline
          sudo ifconfig serviciosA newline 172.24.1.2/24 newline
          sudo route add -net 172.24.2.0/24 gw 172.24.1.222
          & titlehead{textbf{P4/4}} newline
          sudo ifconfig serviciosA down newline
          sudo ifconfig serviciosB newline 172.24.2.2/24 newline
          sudo route add -net 172.24.1.0/24 gw 172.24.2.222 \
          end{tabular}
          end{table}

          end{document}


          enter image description here






          share|improve this answer































            3














            Like this?



            enter image description here



            Note that I've modified the L column type for automatic hanging indentation.



            documentclass{article}
            usepackage[utf8]{inputenc}
            usepackage[spanish]{babel}
            usepackage{array} % for 'newcolumntype' macro
            usepackage{ragged2e} % for 'RaggedRight' macro
            newcolumntype{L}{>{RaggedRightarraybackslash%
            hangafter=1hangindent=1.5em}p{0.45linewidth}}
            newcolumntype{C}{>{centeringarraybackslash}p{0.45linewidth}}
            %% two handy shortcut macros:
            newcommandmC[1]{multicolumn{1}{C|}{#1}}
            newcommandmD[1]{multicolumn{1}{C}{#1}}

            begin{document}
            begin{table}[h!]
            setlengthextrarowheight{2pt}
            centering
            begin{tabular}{L|L}
            mC{textbf{P4/1}} & mD{textbf{P4/3}}\
            sudo ifconfig serviciosB downnewline
            sudo ifconfig serviciosA newline
            172.24.1.1/24 newline
            sudo route add -net 172.24.2.0/24 gw 172.24.1.222
            &
            sudo ifconfig serviciosA down newline
            sudo ifconfig serviciosB newline
            172.24.2.1/24 newline
            sudo route add -net 172.24.1.0/24 gw 172.24.2.222 \
            hline
            mC{textbf{P4/2}} & mD{textbf{P4/4}}\
            sudo ifconfig serviciosB down newline
            sudo ifconfig serviciosA newline
            172.24.1.2/24 newline
            sudo route add -net 172.24.2.0/24 gw 172.24.1.222
            &
            sudo ifconfig serviciosA down newline
            sudo ifconfig serviciosB newline
            172.24.2.2/24 newline
            sudo route add -net 172.24.1.0/24 gw 172.24.2.222 \
            end{tabular}
            end{table}
            end{document}





            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%2f466975%2fcenter-a-title-inside-a-table%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              4














              You can put the titles in their own row and use multicolumn{1}{c}{bold title}. Other than that, I defined a titlehead command which does the job:



              documentclass{article}
              usepackage[utf8]{inputenc}
              usepackage[spanish]{babel}
              usepackage{array}
              newcolumntype{L}{>{raggedrightarraybackslash}p{.4linewidth}}
              renewcommand{arraystretch}{1.2}%
              newcommand{titlehead}[1]{hfilltextbf{#1}hfillnull}%

              begin{document}

              title{empty}
              author{empty}
              maketitle

              begin{table}[h!]
              centering
              setlength{extrarowheight}{2pt}
              begin{tabular}{L|L}
              titlehead{P4/1} newline
              sudo ifconfig serviciosB downnewline
              sudo ifconfig serviciosA newline 172.24.1.1/24 newline
              sudo route add -net 172.24.2.0/24 gw 172.24.1.222
              & titlehead{textbf{P4/3}} newline
              sudo ifconfig serviciosA down
              newline
              sudo ifconfig serviciosB newline 172.24.2.1/24 newline
              sudo route add -net 172.24.1.0/24 gw 172.24.2.222 \
              hline
              titlehead{textbf{P4/2}} newline
              sudo ifconfig serviciosB down newline
              sudo ifconfig serviciosA newline 172.24.1.2/24 newline
              sudo route add -net 172.24.2.0/24 gw 172.24.1.222
              & titlehead{textbf{P4/4}} newline
              sudo ifconfig serviciosA down newline
              sudo ifconfig serviciosB newline 172.24.2.2/24 newline
              sudo route add -net 172.24.1.0/24 gw 172.24.2.222 \
              end{tabular}
              end{table}

              end{document}


              enter image description here






              share|improve this answer




























                4














                You can put the titles in their own row and use multicolumn{1}{c}{bold title}. Other than that, I defined a titlehead command which does the job:



                documentclass{article}
                usepackage[utf8]{inputenc}
                usepackage[spanish]{babel}
                usepackage{array}
                newcolumntype{L}{>{raggedrightarraybackslash}p{.4linewidth}}
                renewcommand{arraystretch}{1.2}%
                newcommand{titlehead}[1]{hfilltextbf{#1}hfillnull}%

                begin{document}

                title{empty}
                author{empty}
                maketitle

                begin{table}[h!]
                centering
                setlength{extrarowheight}{2pt}
                begin{tabular}{L|L}
                titlehead{P4/1} newline
                sudo ifconfig serviciosB downnewline
                sudo ifconfig serviciosA newline 172.24.1.1/24 newline
                sudo route add -net 172.24.2.0/24 gw 172.24.1.222
                & titlehead{textbf{P4/3}} newline
                sudo ifconfig serviciosA down
                newline
                sudo ifconfig serviciosB newline 172.24.2.1/24 newline
                sudo route add -net 172.24.1.0/24 gw 172.24.2.222 \
                hline
                titlehead{textbf{P4/2}} newline
                sudo ifconfig serviciosB down newline
                sudo ifconfig serviciosA newline 172.24.1.2/24 newline
                sudo route add -net 172.24.2.0/24 gw 172.24.1.222
                & titlehead{textbf{P4/4}} newline
                sudo ifconfig serviciosA down newline
                sudo ifconfig serviciosB newline 172.24.2.2/24 newline
                sudo route add -net 172.24.1.0/24 gw 172.24.2.222 \
                end{tabular}
                end{table}

                end{document}


                enter image description here






                share|improve this answer


























                  4












                  4








                  4






                  You can put the titles in their own row and use multicolumn{1}{c}{bold title}. Other than that, I defined a titlehead command which does the job:



                  documentclass{article}
                  usepackage[utf8]{inputenc}
                  usepackage[spanish]{babel}
                  usepackage{array}
                  newcolumntype{L}{>{raggedrightarraybackslash}p{.4linewidth}}
                  renewcommand{arraystretch}{1.2}%
                  newcommand{titlehead}[1]{hfilltextbf{#1}hfillnull}%

                  begin{document}

                  title{empty}
                  author{empty}
                  maketitle

                  begin{table}[h!]
                  centering
                  setlength{extrarowheight}{2pt}
                  begin{tabular}{L|L}
                  titlehead{P4/1} newline
                  sudo ifconfig serviciosB downnewline
                  sudo ifconfig serviciosA newline 172.24.1.1/24 newline
                  sudo route add -net 172.24.2.0/24 gw 172.24.1.222
                  & titlehead{textbf{P4/3}} newline
                  sudo ifconfig serviciosA down
                  newline
                  sudo ifconfig serviciosB newline 172.24.2.1/24 newline
                  sudo route add -net 172.24.1.0/24 gw 172.24.2.222 \
                  hline
                  titlehead{textbf{P4/2}} newline
                  sudo ifconfig serviciosB down newline
                  sudo ifconfig serviciosA newline 172.24.1.2/24 newline
                  sudo route add -net 172.24.2.0/24 gw 172.24.1.222
                  & titlehead{textbf{P4/4}} newline
                  sudo ifconfig serviciosA down newline
                  sudo ifconfig serviciosB newline 172.24.2.2/24 newline
                  sudo route add -net 172.24.1.0/24 gw 172.24.2.222 \
                  end{tabular}
                  end{table}

                  end{document}


                  enter image description here






                  share|improve this answer














                  You can put the titles in their own row and use multicolumn{1}{c}{bold title}. Other than that, I defined a titlehead command which does the job:



                  documentclass{article}
                  usepackage[utf8]{inputenc}
                  usepackage[spanish]{babel}
                  usepackage{array}
                  newcolumntype{L}{>{raggedrightarraybackslash}p{.4linewidth}}
                  renewcommand{arraystretch}{1.2}%
                  newcommand{titlehead}[1]{hfilltextbf{#1}hfillnull}%

                  begin{document}

                  title{empty}
                  author{empty}
                  maketitle

                  begin{table}[h!]
                  centering
                  setlength{extrarowheight}{2pt}
                  begin{tabular}{L|L}
                  titlehead{P4/1} newline
                  sudo ifconfig serviciosB downnewline
                  sudo ifconfig serviciosA newline 172.24.1.1/24 newline
                  sudo route add -net 172.24.2.0/24 gw 172.24.1.222
                  & titlehead{textbf{P4/3}} newline
                  sudo ifconfig serviciosA down
                  newline
                  sudo ifconfig serviciosB newline 172.24.2.1/24 newline
                  sudo route add -net 172.24.1.0/24 gw 172.24.2.222 \
                  hline
                  titlehead{textbf{P4/2}} newline
                  sudo ifconfig serviciosB down newline
                  sudo ifconfig serviciosA newline 172.24.1.2/24 newline
                  sudo route add -net 172.24.2.0/24 gw 172.24.1.222
                  & titlehead{textbf{P4/4}} newline
                  sudo ifconfig serviciosA down newline
                  sudo ifconfig serviciosB newline 172.24.2.2/24 newline
                  sudo route add -net 172.24.1.0/24 gw 172.24.2.222 \
                  end{tabular}
                  end{table}

                  end{document}


                  enter image description here







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Dec 22 '18 at 13:59









                  Sigur

                  24.1k355137




                  24.1k355137










                  answered Dec 22 '18 at 13:30









                  Bernard

                  166k769194




                  166k769194























                      3














                      Like this?



                      enter image description here



                      Note that I've modified the L column type for automatic hanging indentation.



                      documentclass{article}
                      usepackage[utf8]{inputenc}
                      usepackage[spanish]{babel}
                      usepackage{array} % for 'newcolumntype' macro
                      usepackage{ragged2e} % for 'RaggedRight' macro
                      newcolumntype{L}{>{RaggedRightarraybackslash%
                      hangafter=1hangindent=1.5em}p{0.45linewidth}}
                      newcolumntype{C}{>{centeringarraybackslash}p{0.45linewidth}}
                      %% two handy shortcut macros:
                      newcommandmC[1]{multicolumn{1}{C|}{#1}}
                      newcommandmD[1]{multicolumn{1}{C}{#1}}

                      begin{document}
                      begin{table}[h!]
                      setlengthextrarowheight{2pt}
                      centering
                      begin{tabular}{L|L}
                      mC{textbf{P4/1}} & mD{textbf{P4/3}}\
                      sudo ifconfig serviciosB downnewline
                      sudo ifconfig serviciosA newline
                      172.24.1.1/24 newline
                      sudo route add -net 172.24.2.0/24 gw 172.24.1.222
                      &
                      sudo ifconfig serviciosA down newline
                      sudo ifconfig serviciosB newline
                      172.24.2.1/24 newline
                      sudo route add -net 172.24.1.0/24 gw 172.24.2.222 \
                      hline
                      mC{textbf{P4/2}} & mD{textbf{P4/4}}\
                      sudo ifconfig serviciosB down newline
                      sudo ifconfig serviciosA newline
                      172.24.1.2/24 newline
                      sudo route add -net 172.24.2.0/24 gw 172.24.1.222
                      &
                      sudo ifconfig serviciosA down newline
                      sudo ifconfig serviciosB newline
                      172.24.2.2/24 newline
                      sudo route add -net 172.24.1.0/24 gw 172.24.2.222 \
                      end{tabular}
                      end{table}
                      end{document}





                      share|improve this answer


























                        3














                        Like this?



                        enter image description here



                        Note that I've modified the L column type for automatic hanging indentation.



                        documentclass{article}
                        usepackage[utf8]{inputenc}
                        usepackage[spanish]{babel}
                        usepackage{array} % for 'newcolumntype' macro
                        usepackage{ragged2e} % for 'RaggedRight' macro
                        newcolumntype{L}{>{RaggedRightarraybackslash%
                        hangafter=1hangindent=1.5em}p{0.45linewidth}}
                        newcolumntype{C}{>{centeringarraybackslash}p{0.45linewidth}}
                        %% two handy shortcut macros:
                        newcommandmC[1]{multicolumn{1}{C|}{#1}}
                        newcommandmD[1]{multicolumn{1}{C}{#1}}

                        begin{document}
                        begin{table}[h!]
                        setlengthextrarowheight{2pt}
                        centering
                        begin{tabular}{L|L}
                        mC{textbf{P4/1}} & mD{textbf{P4/3}}\
                        sudo ifconfig serviciosB downnewline
                        sudo ifconfig serviciosA newline
                        172.24.1.1/24 newline
                        sudo route add -net 172.24.2.0/24 gw 172.24.1.222
                        &
                        sudo ifconfig serviciosA down newline
                        sudo ifconfig serviciosB newline
                        172.24.2.1/24 newline
                        sudo route add -net 172.24.1.0/24 gw 172.24.2.222 \
                        hline
                        mC{textbf{P4/2}} & mD{textbf{P4/4}}\
                        sudo ifconfig serviciosB down newline
                        sudo ifconfig serviciosA newline
                        172.24.1.2/24 newline
                        sudo route add -net 172.24.2.0/24 gw 172.24.1.222
                        &
                        sudo ifconfig serviciosA down newline
                        sudo ifconfig serviciosB newline
                        172.24.2.2/24 newline
                        sudo route add -net 172.24.1.0/24 gw 172.24.2.222 \
                        end{tabular}
                        end{table}
                        end{document}





                        share|improve this answer
























                          3












                          3








                          3






                          Like this?



                          enter image description here



                          Note that I've modified the L column type for automatic hanging indentation.



                          documentclass{article}
                          usepackage[utf8]{inputenc}
                          usepackage[spanish]{babel}
                          usepackage{array} % for 'newcolumntype' macro
                          usepackage{ragged2e} % for 'RaggedRight' macro
                          newcolumntype{L}{>{RaggedRightarraybackslash%
                          hangafter=1hangindent=1.5em}p{0.45linewidth}}
                          newcolumntype{C}{>{centeringarraybackslash}p{0.45linewidth}}
                          %% two handy shortcut macros:
                          newcommandmC[1]{multicolumn{1}{C|}{#1}}
                          newcommandmD[1]{multicolumn{1}{C}{#1}}

                          begin{document}
                          begin{table}[h!]
                          setlengthextrarowheight{2pt}
                          centering
                          begin{tabular}{L|L}
                          mC{textbf{P4/1}} & mD{textbf{P4/3}}\
                          sudo ifconfig serviciosB downnewline
                          sudo ifconfig serviciosA newline
                          172.24.1.1/24 newline
                          sudo route add -net 172.24.2.0/24 gw 172.24.1.222
                          &
                          sudo ifconfig serviciosA down newline
                          sudo ifconfig serviciosB newline
                          172.24.2.1/24 newline
                          sudo route add -net 172.24.1.0/24 gw 172.24.2.222 \
                          hline
                          mC{textbf{P4/2}} & mD{textbf{P4/4}}\
                          sudo ifconfig serviciosB down newline
                          sudo ifconfig serviciosA newline
                          172.24.1.2/24 newline
                          sudo route add -net 172.24.2.0/24 gw 172.24.1.222
                          &
                          sudo ifconfig serviciosA down newline
                          sudo ifconfig serviciosB newline
                          172.24.2.2/24 newline
                          sudo route add -net 172.24.1.0/24 gw 172.24.2.222 \
                          end{tabular}
                          end{table}
                          end{document}





                          share|improve this answer












                          Like this?



                          enter image description here



                          Note that I've modified the L column type for automatic hanging indentation.



                          documentclass{article}
                          usepackage[utf8]{inputenc}
                          usepackage[spanish]{babel}
                          usepackage{array} % for 'newcolumntype' macro
                          usepackage{ragged2e} % for 'RaggedRight' macro
                          newcolumntype{L}{>{RaggedRightarraybackslash%
                          hangafter=1hangindent=1.5em}p{0.45linewidth}}
                          newcolumntype{C}{>{centeringarraybackslash}p{0.45linewidth}}
                          %% two handy shortcut macros:
                          newcommandmC[1]{multicolumn{1}{C|}{#1}}
                          newcommandmD[1]{multicolumn{1}{C}{#1}}

                          begin{document}
                          begin{table}[h!]
                          setlengthextrarowheight{2pt}
                          centering
                          begin{tabular}{L|L}
                          mC{textbf{P4/1}} & mD{textbf{P4/3}}\
                          sudo ifconfig serviciosB downnewline
                          sudo ifconfig serviciosA newline
                          172.24.1.1/24 newline
                          sudo route add -net 172.24.2.0/24 gw 172.24.1.222
                          &
                          sudo ifconfig serviciosA down newline
                          sudo ifconfig serviciosB newline
                          172.24.2.1/24 newline
                          sudo route add -net 172.24.1.0/24 gw 172.24.2.222 \
                          hline
                          mC{textbf{P4/2}} & mD{textbf{P4/4}}\
                          sudo ifconfig serviciosB down newline
                          sudo ifconfig serviciosA newline
                          172.24.1.2/24 newline
                          sudo route add -net 172.24.2.0/24 gw 172.24.1.222
                          &
                          sudo ifconfig serviciosA down newline
                          sudo ifconfig serviciosB newline
                          172.24.2.2/24 newline
                          sudo route add -net 172.24.1.0/24 gw 172.24.2.222 \
                          end{tabular}
                          end{table}
                          end{document}






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Dec 22 '18 at 13:41









                          Mico

                          274k30371757




                          274k30371757






























                              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.





                              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%2f466975%2fcenter-a-title-inside-a-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