Adding column to table in Latex and optimizing columns width

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












3















Here is my table:
table



This is my code for it:



documentclass[smallextended]svjour3 
usepackagetabularx, booktabs, makecell %
usepackage[a4paper,margin=1in,footskip=0.25in]geometry
renewcommandthetablearabictable
begindocument
begintable[!htb]
centering
sisetuptable-format=1.3, table-number-alignment=center, tight-spacing,% table-column-width =2.5cm
setlengthtabcolsep3pt
small
centering

sisetupdetect-weight,mode=text
renewrobustcmdbfseriesfontseriesbselectfont
renewrobustcmdboldmath
% abbreviation
newrobustcmdBbfseries
% shorten the intercolumn spaces
setlengthtabcolsep4pt
begintabularxlinewidthl>centeringXSSS
toprule

thead DDDDDD \ NNNNN & theadNo. of PPPPPP \ rrrrr & theadDelta CCCCC\ AAAA & theadEEEEEEEEEE\ ccc
& theadPPPPPP Alg\ccc \ [0.5ex]
midrule
POOO HHHH & AAAA to BBBB & 0.524 & 0.546 & B 0.547 \
POOO HHHH & CCCC to DDDD & 0.554 & B 0.546 & B 0.546 \
POOO HHHH& AAAA to BBBB & 0.988 & B0.831 & B 0.831 \
POOO HHHH& CCCC to DDDD & 0.780 & B0.784 & B 0.754 \
CCCCCCC & AAAA to BBBB & 0.622 & 0.723 & B 0.735
\
CCCCCCC & CCCC to DDDD & 0.563 & B0.674 & 0.665
\
AAAAAA & AAAA to BBBB & 0.956 & B 0.957 & 0.956 \
AAAAAA & CCCC to DDDD & 0.949 & B0.955 & B 0.955 \
JJJJJ & RRRRR & 0.999 & B 1.000 & 0.999 \
JJJJJ & KKKKKK & 0.998 & B 0.999 & 0.998\
JJJJJ & HSDFFDSSDF & 0.627 & 0.638 & B 0.646 \
JJJJJ & HSDFFDSSDF & 0.647 & 0.653 & B 0.654 \ [1ex]
bottomrule
endtabularx
% endtabular
captionComparison between aaaaa to bbbbb (In textbfBold the most accurate per line)
labeltable:2
endtable
enddocument


I would like to add at the end of the table another column, with numbers. In addition, I would like to optimize the columns width so that the second column won't be so wide. How can I do it?










share|improve this question



















  • 1





    please, extend your code snippet to complete small document with your table. information contained in your document preamble are important for helping you. added one more column: just write it where you like to ad (& ...)

    – Zarko
    Feb 18 at 14:52












  • in your mwe are still missing some packages ... where you like to ad new column? after last in temporary table?

    – Zarko
    Feb 18 at 15:01















3















Here is my table:
table



This is my code for it:



documentclass[smallextended]svjour3 
usepackagetabularx, booktabs, makecell %
usepackage[a4paper,margin=1in,footskip=0.25in]geometry
renewcommandthetablearabictable
begindocument
begintable[!htb]
centering
sisetuptable-format=1.3, table-number-alignment=center, tight-spacing,% table-column-width =2.5cm
setlengthtabcolsep3pt
small
centering

sisetupdetect-weight,mode=text
renewrobustcmdbfseriesfontseriesbselectfont
renewrobustcmdboldmath
% abbreviation
newrobustcmdBbfseries
% shorten the intercolumn spaces
setlengthtabcolsep4pt
begintabularxlinewidthl>centeringXSSS
toprule

thead DDDDDD \ NNNNN & theadNo. of PPPPPP \ rrrrr & theadDelta CCCCC\ AAAA & theadEEEEEEEEEE\ ccc
& theadPPPPPP Alg\ccc \ [0.5ex]
midrule
POOO HHHH & AAAA to BBBB & 0.524 & 0.546 & B 0.547 \
POOO HHHH & CCCC to DDDD & 0.554 & B 0.546 & B 0.546 \
POOO HHHH& AAAA to BBBB & 0.988 & B0.831 & B 0.831 \
POOO HHHH& CCCC to DDDD & 0.780 & B0.784 & B 0.754 \
CCCCCCC & AAAA to BBBB & 0.622 & 0.723 & B 0.735
\
CCCCCCC & CCCC to DDDD & 0.563 & B0.674 & 0.665
\
AAAAAA & AAAA to BBBB & 0.956 & B 0.957 & 0.956 \
AAAAAA & CCCC to DDDD & 0.949 & B0.955 & B 0.955 \
JJJJJ & RRRRR & 0.999 & B 1.000 & 0.999 \
JJJJJ & KKKKKK & 0.998 & B 0.999 & 0.998\
JJJJJ & HSDFFDSSDF & 0.627 & 0.638 & B 0.646 \
JJJJJ & HSDFFDSSDF & 0.647 & 0.653 & B 0.654 \ [1ex]
bottomrule
endtabularx
% endtabular
captionComparison between aaaaa to bbbbb (In textbfBold the most accurate per line)
labeltable:2
endtable
enddocument


I would like to add at the end of the table another column, with numbers. In addition, I would like to optimize the columns width so that the second column won't be so wide. How can I do it?










share|improve this question



















  • 1





    please, extend your code snippet to complete small document with your table. information contained in your document preamble are important for helping you. added one more column: just write it where you like to ad (& ...)

    – Zarko
    Feb 18 at 14:52












  • in your mwe are still missing some packages ... where you like to ad new column? after last in temporary table?

    – Zarko
    Feb 18 at 15:01













3












3








3


1






Here is my table:
table



This is my code for it:



documentclass[smallextended]svjour3 
usepackagetabularx, booktabs, makecell %
usepackage[a4paper,margin=1in,footskip=0.25in]geometry
renewcommandthetablearabictable
begindocument
begintable[!htb]
centering
sisetuptable-format=1.3, table-number-alignment=center, tight-spacing,% table-column-width =2.5cm
setlengthtabcolsep3pt
small
centering

sisetupdetect-weight,mode=text
renewrobustcmdbfseriesfontseriesbselectfont
renewrobustcmdboldmath
% abbreviation
newrobustcmdBbfseries
% shorten the intercolumn spaces
setlengthtabcolsep4pt
begintabularxlinewidthl>centeringXSSS
toprule

thead DDDDDD \ NNNNN & theadNo. of PPPPPP \ rrrrr & theadDelta CCCCC\ AAAA & theadEEEEEEEEEE\ ccc
& theadPPPPPP Alg\ccc \ [0.5ex]
midrule
POOO HHHH & AAAA to BBBB & 0.524 & 0.546 & B 0.547 \
POOO HHHH & CCCC to DDDD & 0.554 & B 0.546 & B 0.546 \
POOO HHHH& AAAA to BBBB & 0.988 & B0.831 & B 0.831 \
POOO HHHH& CCCC to DDDD & 0.780 & B0.784 & B 0.754 \
CCCCCCC & AAAA to BBBB & 0.622 & 0.723 & B 0.735
\
CCCCCCC & CCCC to DDDD & 0.563 & B0.674 & 0.665
\
AAAAAA & AAAA to BBBB & 0.956 & B 0.957 & 0.956 \
AAAAAA & CCCC to DDDD & 0.949 & B0.955 & B 0.955 \
JJJJJ & RRRRR & 0.999 & B 1.000 & 0.999 \
JJJJJ & KKKKKK & 0.998 & B 0.999 & 0.998\
JJJJJ & HSDFFDSSDF & 0.627 & 0.638 & B 0.646 \
JJJJJ & HSDFFDSSDF & 0.647 & 0.653 & B 0.654 \ [1ex]
bottomrule
endtabularx
% endtabular
captionComparison between aaaaa to bbbbb (In textbfBold the most accurate per line)
labeltable:2
endtable
enddocument


I would like to add at the end of the table another column, with numbers. In addition, I would like to optimize the columns width so that the second column won't be so wide. How can I do it?










share|improve this question
















Here is my table:
table



This is my code for it:



documentclass[smallextended]svjour3 
usepackagetabularx, booktabs, makecell %
usepackage[a4paper,margin=1in,footskip=0.25in]geometry
renewcommandthetablearabictable
begindocument
begintable[!htb]
centering
sisetuptable-format=1.3, table-number-alignment=center, tight-spacing,% table-column-width =2.5cm
setlengthtabcolsep3pt
small
centering

sisetupdetect-weight,mode=text
renewrobustcmdbfseriesfontseriesbselectfont
renewrobustcmdboldmath
% abbreviation
newrobustcmdBbfseries
% shorten the intercolumn spaces
setlengthtabcolsep4pt
begintabularxlinewidthl>centeringXSSS
toprule

thead DDDDDD \ NNNNN & theadNo. of PPPPPP \ rrrrr & theadDelta CCCCC\ AAAA & theadEEEEEEEEEE\ ccc
& theadPPPPPP Alg\ccc \ [0.5ex]
midrule
POOO HHHH & AAAA to BBBB & 0.524 & 0.546 & B 0.547 \
POOO HHHH & CCCC to DDDD & 0.554 & B 0.546 & B 0.546 \
POOO HHHH& AAAA to BBBB & 0.988 & B0.831 & B 0.831 \
POOO HHHH& CCCC to DDDD & 0.780 & B0.784 & B 0.754 \
CCCCCCC & AAAA to BBBB & 0.622 & 0.723 & B 0.735
\
CCCCCCC & CCCC to DDDD & 0.563 & B0.674 & 0.665
\
AAAAAA & AAAA to BBBB & 0.956 & B 0.957 & 0.956 \
AAAAAA & CCCC to DDDD & 0.949 & B0.955 & B 0.955 \
JJJJJ & RRRRR & 0.999 & B 1.000 & 0.999 \
JJJJJ & KKKKKK & 0.998 & B 0.999 & 0.998\
JJJJJ & HSDFFDSSDF & 0.627 & 0.638 & B 0.646 \
JJJJJ & HSDFFDSSDF & 0.647 & 0.653 & B 0.654 \ [1ex]
bottomrule
endtabularx
% endtabular
captionComparison between aaaaa to bbbbb (In textbfBold the most accurate per line)
labeltable:2
endtable
enddocument


I would like to add at the end of the table another column, with numbers. In addition, I would like to optimize the columns width so that the second column won't be so wide. How can I do it?







tables






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 18 at 14:57







Avi

















asked Feb 18 at 14:49









AviAvi

357514




357514







  • 1





    please, extend your code snippet to complete small document with your table. information contained in your document preamble are important for helping you. added one more column: just write it where you like to ad (& ...)

    – Zarko
    Feb 18 at 14:52












  • in your mwe are still missing some packages ... where you like to ad new column? after last in temporary table?

    – Zarko
    Feb 18 at 15:01












  • 1





    please, extend your code snippet to complete small document with your table. information contained in your document preamble are important for helping you. added one more column: just write it where you like to ad (& ...)

    – Zarko
    Feb 18 at 14:52












  • in your mwe are still missing some packages ... where you like to ad new column? after last in temporary table?

    – Zarko
    Feb 18 at 15:01







1




1





please, extend your code snippet to complete small document with your table. information contained in your document preamble are important for helping you. added one more column: just write it where you like to ad (& ...)

– Zarko
Feb 18 at 14:52






please, extend your code snippet to complete small document with your table. information contained in your document preamble are important for helping you. added one more column: just write it where you like to ad (& ...)

– Zarko
Feb 18 at 14:52














in your mwe are still missing some packages ... where you like to ad new column? after last in temporary table?

– Zarko
Feb 18 at 15:01





in your mwe are still missing some packages ... where you like to ad new column? after last in temporary table?

– Zarko
Feb 18 at 15:01










2 Answers
2






active

oldest

votes


















2














By using a tabularx and only having one X column, which is allowed to stretch, this column is forced to be very wide. If it should have its natural width, use a normal tabular instead.



For adding an additional column with numbers, add one S column and add them at the end of each line with & <number>



documentclass[smallextended]svjour3 
usepackagetabularx, booktabs, makecell %
usepackage[a4paper,margin=1in,footskip=0.25in]geometry
usepackagesiunitx
usepackageetoolbox
renewcommandthetablearabictable
begindocument
begintable[!htb]
centering
sisetuptable-format=1.3, table-number-alignment=center, tight-spacing,% table-column-width =2.5cm
setlengthtabcolsep3pt
small
centering

sisetupdetect-weight,mode=text
renewrobustcmdbfseriesfontseriesbselectfont
renewrobustcmdboldmath
% abbreviation
newrobustcmdBbfseries
% shorten the intercolumn spaces
setlengthtabcolsep4pt
begintabularl>centeringlSSSS
toprule

thead DDDDDD \ NNNNN & theadNo. of PPPPPP \ rrrrr & theadDelta CCCCC\ AAAA & theadEEEEEEEEEE\ ccc
& theadPPPPPP Alg\ccc & theadfoo \ [0.5ex]
midrule
POOO HHHH & AAAA to BBBB & 0.524 & 0.546 & B 0.547 & 0.780 \
POOO HHHH & CCCC to DDDD & 0.554 & B 0.546 & B 0.546 & 0.780\
POOO HHHH& AAAA to BBBB & 0.988 & B0.831 & B 0.831 & 0.780 \
POOO HHHH& CCCC to DDDD & 0.780 & B0.784 & B 0.754& 0.780 \
CCCCCCC & AAAA to BBBB & 0.622 & 0.723 & B 0.735
& 0.780 \
CCCCCCC & CCCC to DDDD & 0.563 & B0.674 & 0.665
& 0.780 \
AAAAAA & AAAA to BBBB & 0.956 & B 0.957 & 0.956 & 0.780\
AAAAAA & CCCC to DDDD & 0.949 & B0.955 & B 0.955 & 0.780\
JJJJJ & RRRRR & 0.999 & B 1.000 & 0.999 & 0.780\
JJJJJ & KKKKKK & 0.998 & B 0.999 & 0.998& 0.780\
JJJJJ & HSDFFDSSDF & 0.627 & 0.638 & B 0.646 & 0.780\
JJJJJ & HSDFFDSSDF & 0.647 & 0.653 & B 0.654& 0.780 \ [1ex]
bottomrule
endtabular
% endtabular
captionComparison between aaaaa to bbbbb (In textbfBold the most accurate per line)
labeltable:2
endtable
enddocument


enter image description here






share|improve this answer
































    5














    documentclass[smallextended]svjour3
    usepackage[a4paper,margin=1in,footskip=0.25in]geometry
    usepackagesiunitx
    usepackagebooktabs, makecell, tabularx
    newcommandmcx[1]multicolumn1>centeringarraybackslashX#1
    usepackageetoolbox
    renewrobustcmdbfseriesfontseriesbselectfont
    newrobustcmdBbfseries

    %---------------- show page layout. don't use in a real document!
    usepackageshowframe
    renewcommandShowFrameLinethickness0.15pt
    renewcommand*ShowFrameColorcolorred
    %---------------------------------------------------------------%

    begindocument
    begintable[!htb]
    centering
    sisetuptable-format=1.3,
    detect-weight,
    mode=text
    centering
    begintabularxlinewidthll SS SS
    toprule
    mcxDDDDDDnewline NNNNN
    & mcxNo. of PPPPPP newline rrrrr
    & mcxDelta CCCCCnewline AAAA
    & mcxEEEEEEEEEEnewline ccc
    & mcxPPPPPP Algnewline ccc
    & mcxhere isnewline new column
    \
    midrule
    POOO HHHH & AAAA to BBBB & 0.524 & 0.546 & B 0.547 & 1.234 \
    POOO HHHH & CCCC to DDDD & 0.554 & B 0.546 & B 0.546 & 5.678 \
    bottomrule
    endtabularx
    % endtabular
    captionComparison between aaaaa to bbbbb (In textbfBold the most accurate per line)
    labeltable:2
    endtable
    enddocument


    enter image description here



    (red lines indicate page layout)



    above mwe provide equal widths of columns. since real content c cells and cells heads are unknown, this might not be the best choice. let me know. beside this, i move newcommands to document preamble and remove superfluous sisetup and preserve tabularx table environment.






    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%2f475506%2fadding-column-to-table-in-latex-and-optimizing-columns-width%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









      2














      By using a tabularx and only having one X column, which is allowed to stretch, this column is forced to be very wide. If it should have its natural width, use a normal tabular instead.



      For adding an additional column with numbers, add one S column and add them at the end of each line with & <number>



      documentclass[smallextended]svjour3 
      usepackagetabularx, booktabs, makecell %
      usepackage[a4paper,margin=1in,footskip=0.25in]geometry
      usepackagesiunitx
      usepackageetoolbox
      renewcommandthetablearabictable
      begindocument
      begintable[!htb]
      centering
      sisetuptable-format=1.3, table-number-alignment=center, tight-spacing,% table-column-width =2.5cm
      setlengthtabcolsep3pt
      small
      centering

      sisetupdetect-weight,mode=text
      renewrobustcmdbfseriesfontseriesbselectfont
      renewrobustcmdboldmath
      % abbreviation
      newrobustcmdBbfseries
      % shorten the intercolumn spaces
      setlengthtabcolsep4pt
      begintabularl>centeringlSSSS
      toprule

      thead DDDDDD \ NNNNN & theadNo. of PPPPPP \ rrrrr & theadDelta CCCCC\ AAAA & theadEEEEEEEEEE\ ccc
      & theadPPPPPP Alg\ccc & theadfoo \ [0.5ex]
      midrule
      POOO HHHH & AAAA to BBBB & 0.524 & 0.546 & B 0.547 & 0.780 \
      POOO HHHH & CCCC to DDDD & 0.554 & B 0.546 & B 0.546 & 0.780\
      POOO HHHH& AAAA to BBBB & 0.988 & B0.831 & B 0.831 & 0.780 \
      POOO HHHH& CCCC to DDDD & 0.780 & B0.784 & B 0.754& 0.780 \
      CCCCCCC & AAAA to BBBB & 0.622 & 0.723 & B 0.735
      & 0.780 \
      CCCCCCC & CCCC to DDDD & 0.563 & B0.674 & 0.665
      & 0.780 \
      AAAAAA & AAAA to BBBB & 0.956 & B 0.957 & 0.956 & 0.780\
      AAAAAA & CCCC to DDDD & 0.949 & B0.955 & B 0.955 & 0.780\
      JJJJJ & RRRRR & 0.999 & B 1.000 & 0.999 & 0.780\
      JJJJJ & KKKKKK & 0.998 & B 0.999 & 0.998& 0.780\
      JJJJJ & HSDFFDSSDF & 0.627 & 0.638 & B 0.646 & 0.780\
      JJJJJ & HSDFFDSSDF & 0.647 & 0.653 & B 0.654& 0.780 \ [1ex]
      bottomrule
      endtabular
      % endtabular
      captionComparison between aaaaa to bbbbb (In textbfBold the most accurate per line)
      labeltable:2
      endtable
      enddocument


      enter image description here






      share|improve this answer





























        2














        By using a tabularx and only having one X column, which is allowed to stretch, this column is forced to be very wide. If it should have its natural width, use a normal tabular instead.



        For adding an additional column with numbers, add one S column and add them at the end of each line with & <number>



        documentclass[smallextended]svjour3 
        usepackagetabularx, booktabs, makecell %
        usepackage[a4paper,margin=1in,footskip=0.25in]geometry
        usepackagesiunitx
        usepackageetoolbox
        renewcommandthetablearabictable
        begindocument
        begintable[!htb]
        centering
        sisetuptable-format=1.3, table-number-alignment=center, tight-spacing,% table-column-width =2.5cm
        setlengthtabcolsep3pt
        small
        centering

        sisetupdetect-weight,mode=text
        renewrobustcmdbfseriesfontseriesbselectfont
        renewrobustcmdboldmath
        % abbreviation
        newrobustcmdBbfseries
        % shorten the intercolumn spaces
        setlengthtabcolsep4pt
        begintabularl>centeringlSSSS
        toprule

        thead DDDDDD \ NNNNN & theadNo. of PPPPPP \ rrrrr & theadDelta CCCCC\ AAAA & theadEEEEEEEEEE\ ccc
        & theadPPPPPP Alg\ccc & theadfoo \ [0.5ex]
        midrule
        POOO HHHH & AAAA to BBBB & 0.524 & 0.546 & B 0.547 & 0.780 \
        POOO HHHH & CCCC to DDDD & 0.554 & B 0.546 & B 0.546 & 0.780\
        POOO HHHH& AAAA to BBBB & 0.988 & B0.831 & B 0.831 & 0.780 \
        POOO HHHH& CCCC to DDDD & 0.780 & B0.784 & B 0.754& 0.780 \
        CCCCCCC & AAAA to BBBB & 0.622 & 0.723 & B 0.735
        & 0.780 \
        CCCCCCC & CCCC to DDDD & 0.563 & B0.674 & 0.665
        & 0.780 \
        AAAAAA & AAAA to BBBB & 0.956 & B 0.957 & 0.956 & 0.780\
        AAAAAA & CCCC to DDDD & 0.949 & B0.955 & B 0.955 & 0.780\
        JJJJJ & RRRRR & 0.999 & B 1.000 & 0.999 & 0.780\
        JJJJJ & KKKKKK & 0.998 & B 0.999 & 0.998& 0.780\
        JJJJJ & HSDFFDSSDF & 0.627 & 0.638 & B 0.646 & 0.780\
        JJJJJ & HSDFFDSSDF & 0.647 & 0.653 & B 0.654& 0.780 \ [1ex]
        bottomrule
        endtabular
        % endtabular
        captionComparison between aaaaa to bbbbb (In textbfBold the most accurate per line)
        labeltable:2
        endtable
        enddocument


        enter image description here






        share|improve this answer



























          2












          2








          2







          By using a tabularx and only having one X column, which is allowed to stretch, this column is forced to be very wide. If it should have its natural width, use a normal tabular instead.



          For adding an additional column with numbers, add one S column and add them at the end of each line with & <number>



          documentclass[smallextended]svjour3 
          usepackagetabularx, booktabs, makecell %
          usepackage[a4paper,margin=1in,footskip=0.25in]geometry
          usepackagesiunitx
          usepackageetoolbox
          renewcommandthetablearabictable
          begindocument
          begintable[!htb]
          centering
          sisetuptable-format=1.3, table-number-alignment=center, tight-spacing,% table-column-width =2.5cm
          setlengthtabcolsep3pt
          small
          centering

          sisetupdetect-weight,mode=text
          renewrobustcmdbfseriesfontseriesbselectfont
          renewrobustcmdboldmath
          % abbreviation
          newrobustcmdBbfseries
          % shorten the intercolumn spaces
          setlengthtabcolsep4pt
          begintabularl>centeringlSSSS
          toprule

          thead DDDDDD \ NNNNN & theadNo. of PPPPPP \ rrrrr & theadDelta CCCCC\ AAAA & theadEEEEEEEEEE\ ccc
          & theadPPPPPP Alg\ccc & theadfoo \ [0.5ex]
          midrule
          POOO HHHH & AAAA to BBBB & 0.524 & 0.546 & B 0.547 & 0.780 \
          POOO HHHH & CCCC to DDDD & 0.554 & B 0.546 & B 0.546 & 0.780\
          POOO HHHH& AAAA to BBBB & 0.988 & B0.831 & B 0.831 & 0.780 \
          POOO HHHH& CCCC to DDDD & 0.780 & B0.784 & B 0.754& 0.780 \
          CCCCCCC & AAAA to BBBB & 0.622 & 0.723 & B 0.735
          & 0.780 \
          CCCCCCC & CCCC to DDDD & 0.563 & B0.674 & 0.665
          & 0.780 \
          AAAAAA & AAAA to BBBB & 0.956 & B 0.957 & 0.956 & 0.780\
          AAAAAA & CCCC to DDDD & 0.949 & B0.955 & B 0.955 & 0.780\
          JJJJJ & RRRRR & 0.999 & B 1.000 & 0.999 & 0.780\
          JJJJJ & KKKKKK & 0.998 & B 0.999 & 0.998& 0.780\
          JJJJJ & HSDFFDSSDF & 0.627 & 0.638 & B 0.646 & 0.780\
          JJJJJ & HSDFFDSSDF & 0.647 & 0.653 & B 0.654& 0.780 \ [1ex]
          bottomrule
          endtabular
          % endtabular
          captionComparison between aaaaa to bbbbb (In textbfBold the most accurate per line)
          labeltable:2
          endtable
          enddocument


          enter image description here






          share|improve this answer















          By using a tabularx and only having one X column, which is allowed to stretch, this column is forced to be very wide. If it should have its natural width, use a normal tabular instead.



          For adding an additional column with numbers, add one S column and add them at the end of each line with & <number>



          documentclass[smallextended]svjour3 
          usepackagetabularx, booktabs, makecell %
          usepackage[a4paper,margin=1in,footskip=0.25in]geometry
          usepackagesiunitx
          usepackageetoolbox
          renewcommandthetablearabictable
          begindocument
          begintable[!htb]
          centering
          sisetuptable-format=1.3, table-number-alignment=center, tight-spacing,% table-column-width =2.5cm
          setlengthtabcolsep3pt
          small
          centering

          sisetupdetect-weight,mode=text
          renewrobustcmdbfseriesfontseriesbselectfont
          renewrobustcmdboldmath
          % abbreviation
          newrobustcmdBbfseries
          % shorten the intercolumn spaces
          setlengthtabcolsep4pt
          begintabularl>centeringlSSSS
          toprule

          thead DDDDDD \ NNNNN & theadNo. of PPPPPP \ rrrrr & theadDelta CCCCC\ AAAA & theadEEEEEEEEEE\ ccc
          & theadPPPPPP Alg\ccc & theadfoo \ [0.5ex]
          midrule
          POOO HHHH & AAAA to BBBB & 0.524 & 0.546 & B 0.547 & 0.780 \
          POOO HHHH & CCCC to DDDD & 0.554 & B 0.546 & B 0.546 & 0.780\
          POOO HHHH& AAAA to BBBB & 0.988 & B0.831 & B 0.831 & 0.780 \
          POOO HHHH& CCCC to DDDD & 0.780 & B0.784 & B 0.754& 0.780 \
          CCCCCCC & AAAA to BBBB & 0.622 & 0.723 & B 0.735
          & 0.780 \
          CCCCCCC & CCCC to DDDD & 0.563 & B0.674 & 0.665
          & 0.780 \
          AAAAAA & AAAA to BBBB & 0.956 & B 0.957 & 0.956 & 0.780\
          AAAAAA & CCCC to DDDD & 0.949 & B0.955 & B 0.955 & 0.780\
          JJJJJ & RRRRR & 0.999 & B 1.000 & 0.999 & 0.780\
          JJJJJ & KKKKKK & 0.998 & B 0.999 & 0.998& 0.780\
          JJJJJ & HSDFFDSSDF & 0.627 & 0.638 & B 0.646 & 0.780\
          JJJJJ & HSDFFDSSDF & 0.647 & 0.653 & B 0.654& 0.780 \ [1ex]
          bottomrule
          endtabular
          % endtabular
          captionComparison between aaaaa to bbbbb (In textbfBold the most accurate per line)
          labeltable:2
          endtable
          enddocument


          enter image description here







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Feb 18 at 15:30

























          answered Feb 18 at 15:24









          user181777user181777

          1085




          1085





















              5














              documentclass[smallextended]svjour3
              usepackage[a4paper,margin=1in,footskip=0.25in]geometry
              usepackagesiunitx
              usepackagebooktabs, makecell, tabularx
              newcommandmcx[1]multicolumn1>centeringarraybackslashX#1
              usepackageetoolbox
              renewrobustcmdbfseriesfontseriesbselectfont
              newrobustcmdBbfseries

              %---------------- show page layout. don't use in a real document!
              usepackageshowframe
              renewcommandShowFrameLinethickness0.15pt
              renewcommand*ShowFrameColorcolorred
              %---------------------------------------------------------------%

              begindocument
              begintable[!htb]
              centering
              sisetuptable-format=1.3,
              detect-weight,
              mode=text
              centering
              begintabularxlinewidthll SS SS
              toprule
              mcxDDDDDDnewline NNNNN
              & mcxNo. of PPPPPP newline rrrrr
              & mcxDelta CCCCCnewline AAAA
              & mcxEEEEEEEEEEnewline ccc
              & mcxPPPPPP Algnewline ccc
              & mcxhere isnewline new column
              \
              midrule
              POOO HHHH & AAAA to BBBB & 0.524 & 0.546 & B 0.547 & 1.234 \
              POOO HHHH & CCCC to DDDD & 0.554 & B 0.546 & B 0.546 & 5.678 \
              bottomrule
              endtabularx
              % endtabular
              captionComparison between aaaaa to bbbbb (In textbfBold the most accurate per line)
              labeltable:2
              endtable
              enddocument


              enter image description here



              (red lines indicate page layout)



              above mwe provide equal widths of columns. since real content c cells and cells heads are unknown, this might not be the best choice. let me know. beside this, i move newcommands to document preamble and remove superfluous sisetup and preserve tabularx table environment.






              share|improve this answer





























                5














                documentclass[smallextended]svjour3
                usepackage[a4paper,margin=1in,footskip=0.25in]geometry
                usepackagesiunitx
                usepackagebooktabs, makecell, tabularx
                newcommandmcx[1]multicolumn1>centeringarraybackslashX#1
                usepackageetoolbox
                renewrobustcmdbfseriesfontseriesbselectfont
                newrobustcmdBbfseries

                %---------------- show page layout. don't use in a real document!
                usepackageshowframe
                renewcommandShowFrameLinethickness0.15pt
                renewcommand*ShowFrameColorcolorred
                %---------------------------------------------------------------%

                begindocument
                begintable[!htb]
                centering
                sisetuptable-format=1.3,
                detect-weight,
                mode=text
                centering
                begintabularxlinewidthll SS SS
                toprule
                mcxDDDDDDnewline NNNNN
                & mcxNo. of PPPPPP newline rrrrr
                & mcxDelta CCCCCnewline AAAA
                & mcxEEEEEEEEEEnewline ccc
                & mcxPPPPPP Algnewline ccc
                & mcxhere isnewline new column
                \
                midrule
                POOO HHHH & AAAA to BBBB & 0.524 & 0.546 & B 0.547 & 1.234 \
                POOO HHHH & CCCC to DDDD & 0.554 & B 0.546 & B 0.546 & 5.678 \
                bottomrule
                endtabularx
                % endtabular
                captionComparison between aaaaa to bbbbb (In textbfBold the most accurate per line)
                labeltable:2
                endtable
                enddocument


                enter image description here



                (red lines indicate page layout)



                above mwe provide equal widths of columns. since real content c cells and cells heads are unknown, this might not be the best choice. let me know. beside this, i move newcommands to document preamble and remove superfluous sisetup and preserve tabularx table environment.






                share|improve this answer



























                  5












                  5








                  5







                  documentclass[smallextended]svjour3
                  usepackage[a4paper,margin=1in,footskip=0.25in]geometry
                  usepackagesiunitx
                  usepackagebooktabs, makecell, tabularx
                  newcommandmcx[1]multicolumn1>centeringarraybackslashX#1
                  usepackageetoolbox
                  renewrobustcmdbfseriesfontseriesbselectfont
                  newrobustcmdBbfseries

                  %---------------- show page layout. don't use in a real document!
                  usepackageshowframe
                  renewcommandShowFrameLinethickness0.15pt
                  renewcommand*ShowFrameColorcolorred
                  %---------------------------------------------------------------%

                  begindocument
                  begintable[!htb]
                  centering
                  sisetuptable-format=1.3,
                  detect-weight,
                  mode=text
                  centering
                  begintabularxlinewidthll SS SS
                  toprule
                  mcxDDDDDDnewline NNNNN
                  & mcxNo. of PPPPPP newline rrrrr
                  & mcxDelta CCCCCnewline AAAA
                  & mcxEEEEEEEEEEnewline ccc
                  & mcxPPPPPP Algnewline ccc
                  & mcxhere isnewline new column
                  \
                  midrule
                  POOO HHHH & AAAA to BBBB & 0.524 & 0.546 & B 0.547 & 1.234 \
                  POOO HHHH & CCCC to DDDD & 0.554 & B 0.546 & B 0.546 & 5.678 \
                  bottomrule
                  endtabularx
                  % endtabular
                  captionComparison between aaaaa to bbbbb (In textbfBold the most accurate per line)
                  labeltable:2
                  endtable
                  enddocument


                  enter image description here



                  (red lines indicate page layout)



                  above mwe provide equal widths of columns. since real content c cells and cells heads are unknown, this might not be the best choice. let me know. beside this, i move newcommands to document preamble and remove superfluous sisetup and preserve tabularx table environment.






                  share|improve this answer















                  documentclass[smallextended]svjour3
                  usepackage[a4paper,margin=1in,footskip=0.25in]geometry
                  usepackagesiunitx
                  usepackagebooktabs, makecell, tabularx
                  newcommandmcx[1]multicolumn1>centeringarraybackslashX#1
                  usepackageetoolbox
                  renewrobustcmdbfseriesfontseriesbselectfont
                  newrobustcmdBbfseries

                  %---------------- show page layout. don't use in a real document!
                  usepackageshowframe
                  renewcommandShowFrameLinethickness0.15pt
                  renewcommand*ShowFrameColorcolorred
                  %---------------------------------------------------------------%

                  begindocument
                  begintable[!htb]
                  centering
                  sisetuptable-format=1.3,
                  detect-weight,
                  mode=text
                  centering
                  begintabularxlinewidthll SS SS
                  toprule
                  mcxDDDDDDnewline NNNNN
                  & mcxNo. of PPPPPP newline rrrrr
                  & mcxDelta CCCCCnewline AAAA
                  & mcxEEEEEEEEEEnewline ccc
                  & mcxPPPPPP Algnewline ccc
                  & mcxhere isnewline new column
                  \
                  midrule
                  POOO HHHH & AAAA to BBBB & 0.524 & 0.546 & B 0.547 & 1.234 \
                  POOO HHHH & CCCC to DDDD & 0.554 & B 0.546 & B 0.546 & 5.678 \
                  bottomrule
                  endtabularx
                  % endtabular
                  captionComparison between aaaaa to bbbbb (In textbfBold the most accurate per line)
                  labeltable:2
                  endtable
                  enddocument


                  enter image description here



                  (red lines indicate page layout)



                  above mwe provide equal widths of columns. since real content c cells and cells heads are unknown, this might not be the best choice. let me know. beside this, i move newcommands to document preamble and remove superfluous sisetup and preserve tabularx table environment.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Feb 18 at 16:15

























                  answered Feb 18 at 15:26









                  ZarkoZarko

                  127k868166




                  127k868166



























                      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%2f475506%2fadding-column-to-table-in-latex-and-optimizing-columns-width%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

                      How to check contact read email or not when send email to Individual?

                      Bahrain

                      Postfix configuration issue with fips on centos 7; mailgun relay