Why is latex adding a newline when trying to create a table within a table?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












I have this Latex code:



begintabularc
$h_fe = 70$ & $h_fe = 170$ & $h_fe = 250$ \
begintabularc
& textbfCalc. & textbfSim. & textbf% Diff. \
$I_C$ & 1.838 & 1.780 & 3.15 \
$V_B$ & 2.975& 2.992 & 0.57 \
$V_C$ & 6.692& 6.796 & 1.55\
$V_E$ & 2.210& 2.203& 0.32\
endtabular &
begintabularc
textbfCalc. & textbfSim. & textbfDiff \
&
endtabular &
begintabularc
textbfCalc. & textbfSim. & textbfDiff \
&
endtabular
endtabular


The output is: enter image description here



How do I stop Latex from adding a leaving a space at the top of the 2nd and 3rd columns?










share|improve this question







New contributor




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























    up vote
    2
    down vote

    favorite












    I have this Latex code:



    begintabularc
    $h_fe = 70$ & $h_fe = 170$ & $h_fe = 250$ \
    begintabularc
    & textbfCalc. & textbfSim. & textbf% Diff. \
    $I_C$ & 1.838 & 1.780 & 3.15 \
    $V_B$ & 2.975& 2.992 & 0.57 \
    $V_C$ & 6.692& 6.796 & 1.55\
    $V_E$ & 2.210& 2.203& 0.32\
    endtabular &
    begintabularc
    textbfCalc. & textbfSim. & textbfDiff \
    &
    endtabular &
    begintabularc
    textbfCalc. & textbfSim. & textbfDiff \
    &
    endtabular
    endtabular


    The output is: enter image description here



    How do I stop Latex from adding a leaving a space at the top of the 2nd and 3rd columns?










    share|improve this question







    New contributor




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





















      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      I have this Latex code:



      begintabularc
      $h_fe = 70$ & $h_fe = 170$ & $h_fe = 250$ \
      begintabularc
      & textbfCalc. & textbfSim. & textbf% Diff. \
      $I_C$ & 1.838 & 1.780 & 3.15 \
      $V_B$ & 2.975& 2.992 & 0.57 \
      $V_C$ & 6.692& 6.796 & 1.55\
      $V_E$ & 2.210& 2.203& 0.32\
      endtabular &
      begintabularc
      textbfCalc. & textbfSim. & textbfDiff \
      &
      endtabular &
      begintabularc
      textbfCalc. & textbfSim. & textbfDiff \
      &
      endtabular
      endtabular


      The output is: enter image description here



      How do I stop Latex from adding a leaving a space at the top of the 2nd and 3rd columns?










      share|improve this question







      New contributor




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











      I have this Latex code:



      begintabularc
      $h_fe = 70$ & $h_fe = 170$ & $h_fe = 250$ \
      begintabularc
      & textbfCalc. & textbfSim. & textbf% Diff. \
      $I_C$ & 1.838 & 1.780 & 3.15 \
      $V_B$ & 2.975& 2.992 & 0.57 \
      $V_C$ & 6.692& 6.796 & 1.55\
      $V_E$ & 2.210& 2.203& 0.32\
      endtabular &
      begintabularc
      textbfCalc. & textbfSim. & textbfDiff \
      &
      endtabular &
      begintabularc
      textbfCalc. & textbfSim. & textbfDiff \
      &
      endtabular
      endtabular


      The output is: enter image description here



      How do I stop Latex from adding a leaving a space at the top of the 2nd and 3rd columns?







      tables






      share|improve this question







      New contributor




      Rish 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




      Rish 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






      New contributor




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









      asked 49 mins ago









      Rish

      111




      111




      New contributor




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





      New contributor





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






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




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          4
          down vote













          You don't need to nest tabulars in the first place: use multicolumn for spanning several columns.



          documentclassarticle

          begindocument

          begintabularc
          & multicolumn3$h_fe = 70$
          & multicolumn3$h_fe = 170$
          & multicolumn3$h_fe = 250$ \
          & textbfCalc. & textbfSim. & textbf% Diff.
          & textbfCalc. & textbfSim. & textbf% Diff.
          & textbfCalc. & textbfSim. & textbf% Diff. \
          $I_C$ & 1.838 & 1.780 & 3.15 & & & & & & \
          $V_B$ & 2.975 & 2.992 & 0.57 & & & & & & \
          $V_C$ & 6.692 & 6.796 & 1.55 & & & & & & \
          $V_E$ & 2.210 & 2.203 & 0.32 & & & & & & \
          endtabular

          enddocument


          enter image description here



          A different realization that saves space and avoids the vertical rules. You can explain in the caption what “C”, “S” and “% D” mean.



          documentclassarticle
          usepackagesiunitx,booktabs

          begindocument

          begintabular
          l
          *3S[table-format=1.3] S[table-format=1.3] S[table-format=1.2]

          toprule
          & multicolumn3c$h_mathrmfe = 70$
          & multicolumn3c$h_mathrmfe = 170$
          & multicolumn3c$h_mathrmfe = 250$ \
          cmidrule(lr)2-4 cmidrule(lr)5-7 cmidrule(lr)8-10
          & C & S & % D & C & S & % D & C & S & % D \
          midrule
          $I_C$ & 1.838 & 1.780 & 3.15 & 1.111 & 2.222 & 3.3 & 4.444 & 5.555 & 6.6 \
          $V_B$ & 2.975 & 2.992 & 0.57 & & & & & & \
          $V_C$ & 6.692 & 6.796 & 1.55 & & & & & & \
          $V_E$ & 2.210 & 2.203 & 0.32 & & & & & & \
          bottomrule
          endtabular

          enddocument


          enter image description here






          share|improve this answer





























            up vote
            3
            down vote













            Top-align [t] all the inner tabulars. By default, tabular is vertically center-aligned.



            documentclassarticle
            begindocument
            begintabularc
            $h_fe = 70$ & $h_fe = 170$ & $h_fe = 250$ \
            begintabular[t]c
            & textbfCalc. & textbfSim. & textbf% Diff. \
            $I_C$ & 1.838 & 1.780 & 3.15 \
            $V_B$ & 2.975& 2.992 & 0.57 \
            $V_C$ & 6.692& 6.796 & 1.55\
            $V_E$ & 2.210& 2.203& 0.32\
            endtabular &
            begintabular[t]c
            textbfCalc. & textbfSim. & textbfDiff \
            &
            endtabular &
            begintabular[t]c
            textbfCalc. & textbfSim. & textbfDiff \
            &
            endtabular
            endtabular
            enddocument


            enter image description here






            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: false,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );






              Rish 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%2f453448%2fwhy-is-latex-adding-a-newline-when-trying-to-create-a-table-within-a-table%23new-answer', 'question_page');

              );

              Post as a guest






























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              4
              down vote













              You don't need to nest tabulars in the first place: use multicolumn for spanning several columns.



              documentclassarticle

              begindocument

              begintabularc
              & multicolumn3$h_fe = 70$
              & multicolumn3$h_fe = 170$
              & multicolumn3$h_fe = 250$ \
              & textbfCalc. & textbfSim. & textbf% Diff.
              & textbfCalc. & textbfSim. & textbf% Diff.
              & textbfCalc. & textbfSim. & textbf% Diff. \
              $I_C$ & 1.838 & 1.780 & 3.15 & & & & & & \
              $V_B$ & 2.975 & 2.992 & 0.57 & & & & & & \
              $V_C$ & 6.692 & 6.796 & 1.55 & & & & & & \
              $V_E$ & 2.210 & 2.203 & 0.32 & & & & & & \
              endtabular

              enddocument


              enter image description here



              A different realization that saves space and avoids the vertical rules. You can explain in the caption what “C”, “S” and “% D” mean.



              documentclassarticle
              usepackagesiunitx,booktabs

              begindocument

              begintabular
              l
              *3S[table-format=1.3] S[table-format=1.3] S[table-format=1.2]

              toprule
              & multicolumn3c$h_mathrmfe = 70$
              & multicolumn3c$h_mathrmfe = 170$
              & multicolumn3c$h_mathrmfe = 250$ \
              cmidrule(lr)2-4 cmidrule(lr)5-7 cmidrule(lr)8-10
              & C & S & % D & C & S & % D & C & S & % D \
              midrule
              $I_C$ & 1.838 & 1.780 & 3.15 & 1.111 & 2.222 & 3.3 & 4.444 & 5.555 & 6.6 \
              $V_B$ & 2.975 & 2.992 & 0.57 & & & & & & \
              $V_C$ & 6.692 & 6.796 & 1.55 & & & & & & \
              $V_E$ & 2.210 & 2.203 & 0.32 & & & & & & \
              bottomrule
              endtabular

              enddocument


              enter image description here






              share|improve this answer


























                up vote
                4
                down vote













                You don't need to nest tabulars in the first place: use multicolumn for spanning several columns.



                documentclassarticle

                begindocument

                begintabularc
                & multicolumn3$h_fe = 70$
                & multicolumn3$h_fe = 170$
                & multicolumn3$h_fe = 250$ \
                & textbfCalc. & textbfSim. & textbf% Diff.
                & textbfCalc. & textbfSim. & textbf% Diff.
                & textbfCalc. & textbfSim. & textbf% Diff. \
                $I_C$ & 1.838 & 1.780 & 3.15 & & & & & & \
                $V_B$ & 2.975 & 2.992 & 0.57 & & & & & & \
                $V_C$ & 6.692 & 6.796 & 1.55 & & & & & & \
                $V_E$ & 2.210 & 2.203 & 0.32 & & & & & & \
                endtabular

                enddocument


                enter image description here



                A different realization that saves space and avoids the vertical rules. You can explain in the caption what “C”, “S” and “% D” mean.



                documentclassarticle
                usepackagesiunitx,booktabs

                begindocument

                begintabular
                l
                *3S[table-format=1.3] S[table-format=1.3] S[table-format=1.2]

                toprule
                & multicolumn3c$h_mathrmfe = 70$
                & multicolumn3c$h_mathrmfe = 170$
                & multicolumn3c$h_mathrmfe = 250$ \
                cmidrule(lr)2-4 cmidrule(lr)5-7 cmidrule(lr)8-10
                & C & S & % D & C & S & % D & C & S & % D \
                midrule
                $I_C$ & 1.838 & 1.780 & 3.15 & 1.111 & 2.222 & 3.3 & 4.444 & 5.555 & 6.6 \
                $V_B$ & 2.975 & 2.992 & 0.57 & & & & & & \
                $V_C$ & 6.692 & 6.796 & 1.55 & & & & & & \
                $V_E$ & 2.210 & 2.203 & 0.32 & & & & & & \
                bottomrule
                endtabular

                enddocument


                enter image description here






                share|improve this answer
























                  up vote
                  4
                  down vote










                  up vote
                  4
                  down vote









                  You don't need to nest tabulars in the first place: use multicolumn for spanning several columns.



                  documentclassarticle

                  begindocument

                  begintabularc
                  & multicolumn3$h_fe = 70$
                  & multicolumn3$h_fe = 170$
                  & multicolumn3$h_fe = 250$ \
                  & textbfCalc. & textbfSim. & textbf% Diff.
                  & textbfCalc. & textbfSim. & textbf% Diff.
                  & textbfCalc. & textbfSim. & textbf% Diff. \
                  $I_C$ & 1.838 & 1.780 & 3.15 & & & & & & \
                  $V_B$ & 2.975 & 2.992 & 0.57 & & & & & & \
                  $V_C$ & 6.692 & 6.796 & 1.55 & & & & & & \
                  $V_E$ & 2.210 & 2.203 & 0.32 & & & & & & \
                  endtabular

                  enddocument


                  enter image description here



                  A different realization that saves space and avoids the vertical rules. You can explain in the caption what “C”, “S” and “% D” mean.



                  documentclassarticle
                  usepackagesiunitx,booktabs

                  begindocument

                  begintabular
                  l
                  *3S[table-format=1.3] S[table-format=1.3] S[table-format=1.2]

                  toprule
                  & multicolumn3c$h_mathrmfe = 70$
                  & multicolumn3c$h_mathrmfe = 170$
                  & multicolumn3c$h_mathrmfe = 250$ \
                  cmidrule(lr)2-4 cmidrule(lr)5-7 cmidrule(lr)8-10
                  & C & S & % D & C & S & % D & C & S & % D \
                  midrule
                  $I_C$ & 1.838 & 1.780 & 3.15 & 1.111 & 2.222 & 3.3 & 4.444 & 5.555 & 6.6 \
                  $V_B$ & 2.975 & 2.992 & 0.57 & & & & & & \
                  $V_C$ & 6.692 & 6.796 & 1.55 & & & & & & \
                  $V_E$ & 2.210 & 2.203 & 0.32 & & & & & & \
                  bottomrule
                  endtabular

                  enddocument


                  enter image description here






                  share|improve this answer














                  You don't need to nest tabulars in the first place: use multicolumn for spanning several columns.



                  documentclassarticle

                  begindocument

                  begintabularc
                  & multicolumn3$h_fe = 70$
                  & multicolumn3$h_fe = 170$
                  & multicolumn3$h_fe = 250$ \
                  & textbfCalc. & textbfSim. & textbf% Diff.
                  & textbfCalc. & textbfSim. & textbf% Diff.
                  & textbfCalc. & textbfSim. & textbf% Diff. \
                  $I_C$ & 1.838 & 1.780 & 3.15 & & & & & & \
                  $V_B$ & 2.975 & 2.992 & 0.57 & & & & & & \
                  $V_C$ & 6.692 & 6.796 & 1.55 & & & & & & \
                  $V_E$ & 2.210 & 2.203 & 0.32 & & & & & & \
                  endtabular

                  enddocument


                  enter image description here



                  A different realization that saves space and avoids the vertical rules. You can explain in the caption what “C”, “S” and “% D” mean.



                  documentclassarticle
                  usepackagesiunitx,booktabs

                  begindocument

                  begintabular
                  l
                  *3S[table-format=1.3] S[table-format=1.3] S[table-format=1.2]

                  toprule
                  & multicolumn3c$h_mathrmfe = 70$
                  & multicolumn3c$h_mathrmfe = 170$
                  & multicolumn3c$h_mathrmfe = 250$ \
                  cmidrule(lr)2-4 cmidrule(lr)5-7 cmidrule(lr)8-10
                  & C & S & % D & C & S & % D & C & S & % D \
                  midrule
                  $I_C$ & 1.838 & 1.780 & 3.15 & 1.111 & 2.222 & 3.3 & 4.444 & 5.555 & 6.6 \
                  $V_B$ & 2.975 & 2.992 & 0.57 & & & & & & \
                  $V_C$ & 6.692 & 6.796 & 1.55 & & & & & & \
                  $V_E$ & 2.210 & 2.203 & 0.32 & & & & & & \
                  bottomrule
                  endtabular

                  enddocument


                  enter image description here







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited 32 mins ago

























                  answered 40 mins ago









                  egreg

                  686k8418283078




                  686k8418283078




















                      up vote
                      3
                      down vote













                      Top-align [t] all the inner tabulars. By default, tabular is vertically center-aligned.



                      documentclassarticle
                      begindocument
                      begintabularc
                      $h_fe = 70$ & $h_fe = 170$ & $h_fe = 250$ \
                      begintabular[t]c
                      & textbfCalc. & textbfSim. & textbf% Diff. \
                      $I_C$ & 1.838 & 1.780 & 3.15 \
                      $V_B$ & 2.975& 2.992 & 0.57 \
                      $V_C$ & 6.692& 6.796 & 1.55\
                      $V_E$ & 2.210& 2.203& 0.32\
                      endtabular &
                      begintabular[t]c
                      textbfCalc. & textbfSim. & textbfDiff \
                      &
                      endtabular &
                      begintabular[t]c
                      textbfCalc. & textbfSim. & textbfDiff \
                      &
                      endtabular
                      endtabular
                      enddocument


                      enter image description here






                      share|improve this answer
























                        up vote
                        3
                        down vote













                        Top-align [t] all the inner tabulars. By default, tabular is vertically center-aligned.



                        documentclassarticle
                        begindocument
                        begintabularc
                        $h_fe = 70$ & $h_fe = 170$ & $h_fe = 250$ \
                        begintabular[t]c
                        & textbfCalc. & textbfSim. & textbf% Diff. \
                        $I_C$ & 1.838 & 1.780 & 3.15 \
                        $V_B$ & 2.975& 2.992 & 0.57 \
                        $V_C$ & 6.692& 6.796 & 1.55\
                        $V_E$ & 2.210& 2.203& 0.32\
                        endtabular &
                        begintabular[t]c
                        textbfCalc. & textbfSim. & textbfDiff \
                        &
                        endtabular &
                        begintabular[t]c
                        textbfCalc. & textbfSim. & textbfDiff \
                        &
                        endtabular
                        endtabular
                        enddocument


                        enter image description here






                        share|improve this answer






















                          up vote
                          3
                          down vote










                          up vote
                          3
                          down vote









                          Top-align [t] all the inner tabulars. By default, tabular is vertically center-aligned.



                          documentclassarticle
                          begindocument
                          begintabularc
                          $h_fe = 70$ & $h_fe = 170$ & $h_fe = 250$ \
                          begintabular[t]c
                          & textbfCalc. & textbfSim. & textbf% Diff. \
                          $I_C$ & 1.838 & 1.780 & 3.15 \
                          $V_B$ & 2.975& 2.992 & 0.57 \
                          $V_C$ & 6.692& 6.796 & 1.55\
                          $V_E$ & 2.210& 2.203& 0.32\
                          endtabular &
                          begintabular[t]c
                          textbfCalc. & textbfSim. & textbfDiff \
                          &
                          endtabular &
                          begintabular[t]c
                          textbfCalc. & textbfSim. & textbfDiff \
                          &
                          endtabular
                          endtabular
                          enddocument


                          enter image description here






                          share|improve this answer












                          Top-align [t] all the inner tabulars. By default, tabular is vertically center-aligned.



                          documentclassarticle
                          begindocument
                          begintabularc
                          $h_fe = 70$ & $h_fe = 170$ & $h_fe = 250$ \
                          begintabular[t]c
                          & textbfCalc. & textbfSim. & textbf% Diff. \
                          $I_C$ & 1.838 & 1.780 & 3.15 \
                          $V_B$ & 2.975& 2.992 & 0.57 \
                          $V_C$ & 6.692& 6.796 & 1.55\
                          $V_E$ & 2.210& 2.203& 0.32\
                          endtabular &
                          begintabular[t]c
                          textbfCalc. & textbfSim. & textbfDiff \
                          &
                          endtabular &
                          begintabular[t]c
                          textbfCalc. & textbfSim. & textbfDiff \
                          &
                          endtabular
                          endtabular
                          enddocument


                          enter image description here







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 43 mins ago









                          Steven B. Segletes

                          148k9186390




                          148k9186390




















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









                               

                              draft saved


                              draft discarded


















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












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











                              Rish 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%2f453448%2fwhy-is-latex-adding-a-newline-when-trying-to-create-a-table-within-a-table%23new-answer', 'question_page');

                              );

                              Post as a guest













































































                              Comments

                              Popular posts from this blog

                              What does second last employer means? [closed]

                              List of Gilmore Girls characters

                              Confectionery