How to make columns right aligned in a wide table












0














I'm grateful for the advice I got from this comunity before on how to make columns right aligned in wide tables. But now I cannot domesticate the following table that has 15 columns, some of them contain negative numbers. In addition, I lost the track on how to make the columns right aligned. Suggestions are welcome! Thank you.



documentclass{book}
usepackage[spanish]{babel}
usepackage[utf8]{inputenc} % Required for inputting international characters

% Paquetes necesarios para las tablas
usepackage[flushleft]{threeparttable}
usepackage{array,calc}
usepackage{varwidth}
newcolumntype{Z}{>{raggedleftarraybackslash}X}
usepackage{booktabs,tabularx,ragged2e}
usepackage{subcaption}
usepackage{graphicx}
usepackage{multirow}
usepackage[margin=1in]{geometry} % choose page size parameters suitably
addtocaptionsspanish{renewcommand{tablename}{Tabla}}
%%%

begin{document}



begin{table}[th]
footnotesize
sf
caption{sf Adultos mayores beneficiarios previsionales según grupo de edades y conformación del hogar, en %}
label{tab:table32}


begin{threeparttable}
begin{tabularx}{textwidth}{@{} l *{15}{Z} @{}}
toprule toprule
& multicolumn{3}{c}{65 a 69 años}
& multicolumn{3}{c}{70 a 74 años}
& multicolumn{3}{c}{75 a 79 años}
& multicolumn{3}{c}{80 y más años}
& multicolumn{3}{c}{Total} \
cmidrule(lr){2-4} cmidrule(lr){5-7}
cmidrule(lr){8-10} cmidrule(lr){11-13}
cmidrule(lr){14-16}
& 2003 & 2013 & Var.
& 2003 & 2013 & Var.
& 2003 & 2013 & Var.
& 2003 & 2013 & Var.
& 2003 & 2013 & Var.\
midrule
Hogar unipersonal
& 20,8 & 16,3 & $-$4,5
& 19,3 & 23,5 & 4,2
& 30,2 & 29,0 & $-$1,2
& 35,6 & 31,0 & $-$4.6
& 26,8 & 24,7 & $-$2,1 \
Hogar bipersonal - un solo beneficiario
& 6,3 & 1,8 & $-$4,5
& 17,0 & 1,3 & $-$15,7
& 13,1 & 0,2 & $-$12,9
& 10,0 & 0,7 & $-$9,3
& 11,9 & 1,0 & $-$10,9 \
Hogar bipersonal - dos beneficiarios
& 10,5 & 23,9 & 13,4
& 20,2 & 26,4 & 6,2
& 15,7 & 29,6 & 13,9
& 13,4 & 26,0 & 12,6
& 15,3 & 26,4 & 11,1 \
Hogar multipersonal
& 62,4 & 58,0 & $-$4,4
& 43,4 & 48,8 & 5,4
& 41,0 & 41,2 & 0,1
& 40,9 & 42,3 & 1,4
& 46,0 & 48,0 & 1,9 \
\
multicolumn{16}{l}{Adultos mayores en hogares unipersonalestextsuperscript{a}} \
Varones & 28,3 & 28,9 & 0,6
& 21,1 & 27,8 & 6,7
& 23,1 & 24,1 & 1,0
& 22,3 & 23,8 & 1,5
& 23,3 & 25,7 & 2,5 \
Mujeres & 71,7 & 71,1 & $-$0,6
& 78,9 & 72,2 & $-$6,7
& 76,9 & 75,9 & $-$1,0
& 77,7 & 76,2 & $-$1,5
& 76,7 & 74,3 & $-$2,5 \
bottomrule
end{tabularx}

begin{tablenotes}
footnotesize
smallskip
item a: Como porcentaje del total de hogares unipersonales conformados por adultos mayores.
item Fuente: Elaboración propia en base a la EPH.
end{tablenotes}
end{threeparttable}

end{table}

end{document}








share



























    0














    I'm grateful for the advice I got from this comunity before on how to make columns right aligned in wide tables. But now I cannot domesticate the following table that has 15 columns, some of them contain negative numbers. In addition, I lost the track on how to make the columns right aligned. Suggestions are welcome! Thank you.



    documentclass{book}
    usepackage[spanish]{babel}
    usepackage[utf8]{inputenc} % Required for inputting international characters

    % Paquetes necesarios para las tablas
    usepackage[flushleft]{threeparttable}
    usepackage{array,calc}
    usepackage{varwidth}
    newcolumntype{Z}{>{raggedleftarraybackslash}X}
    usepackage{booktabs,tabularx,ragged2e}
    usepackage{subcaption}
    usepackage{graphicx}
    usepackage{multirow}
    usepackage[margin=1in]{geometry} % choose page size parameters suitably
    addtocaptionsspanish{renewcommand{tablename}{Tabla}}
    %%%

    begin{document}



    begin{table}[th]
    footnotesize
    sf
    caption{sf Adultos mayores beneficiarios previsionales según grupo de edades y conformación del hogar, en %}
    label{tab:table32}


    begin{threeparttable}
    begin{tabularx}{textwidth}{@{} l *{15}{Z} @{}}
    toprule toprule
    & multicolumn{3}{c}{65 a 69 años}
    & multicolumn{3}{c}{70 a 74 años}
    & multicolumn{3}{c}{75 a 79 años}
    & multicolumn{3}{c}{80 y más años}
    & multicolumn{3}{c}{Total} \
    cmidrule(lr){2-4} cmidrule(lr){5-7}
    cmidrule(lr){8-10} cmidrule(lr){11-13}
    cmidrule(lr){14-16}
    & 2003 & 2013 & Var.
    & 2003 & 2013 & Var.
    & 2003 & 2013 & Var.
    & 2003 & 2013 & Var.
    & 2003 & 2013 & Var.\
    midrule
    Hogar unipersonal
    & 20,8 & 16,3 & $-$4,5
    & 19,3 & 23,5 & 4,2
    & 30,2 & 29,0 & $-$1,2
    & 35,6 & 31,0 & $-$4.6
    & 26,8 & 24,7 & $-$2,1 \
    Hogar bipersonal - un solo beneficiario
    & 6,3 & 1,8 & $-$4,5
    & 17,0 & 1,3 & $-$15,7
    & 13,1 & 0,2 & $-$12,9
    & 10,0 & 0,7 & $-$9,3
    & 11,9 & 1,0 & $-$10,9 \
    Hogar bipersonal - dos beneficiarios
    & 10,5 & 23,9 & 13,4
    & 20,2 & 26,4 & 6,2
    & 15,7 & 29,6 & 13,9
    & 13,4 & 26,0 & 12,6
    & 15,3 & 26,4 & 11,1 \
    Hogar multipersonal
    & 62,4 & 58,0 & $-$4,4
    & 43,4 & 48,8 & 5,4
    & 41,0 & 41,2 & 0,1
    & 40,9 & 42,3 & 1,4
    & 46,0 & 48,0 & 1,9 \
    \
    multicolumn{16}{l}{Adultos mayores en hogares unipersonalestextsuperscript{a}} \
    Varones & 28,3 & 28,9 & 0,6
    & 21,1 & 27,8 & 6,7
    & 23,1 & 24,1 & 1,0
    & 22,3 & 23,8 & 1,5
    & 23,3 & 25,7 & 2,5 \
    Mujeres & 71,7 & 71,1 & $-$0,6
    & 78,9 & 72,2 & $-$6,7
    & 76,9 & 75,9 & $-$1,0
    & 77,7 & 76,2 & $-$1,5
    & 76,7 & 74,3 & $-$2,5 \
    bottomrule
    end{tabularx}

    begin{tablenotes}
    footnotesize
    smallskip
    item a: Como porcentaje del total de hogares unipersonales conformados por adultos mayores.
    item Fuente: Elaboración propia en base a la EPH.
    end{tablenotes}
    end{threeparttable}

    end{table}

    end{document}








    share

























      0












      0








      0







      I'm grateful for the advice I got from this comunity before on how to make columns right aligned in wide tables. But now I cannot domesticate the following table that has 15 columns, some of them contain negative numbers. In addition, I lost the track on how to make the columns right aligned. Suggestions are welcome! Thank you.



      documentclass{book}
      usepackage[spanish]{babel}
      usepackage[utf8]{inputenc} % Required for inputting international characters

      % Paquetes necesarios para las tablas
      usepackage[flushleft]{threeparttable}
      usepackage{array,calc}
      usepackage{varwidth}
      newcolumntype{Z}{>{raggedleftarraybackslash}X}
      usepackage{booktabs,tabularx,ragged2e}
      usepackage{subcaption}
      usepackage{graphicx}
      usepackage{multirow}
      usepackage[margin=1in]{geometry} % choose page size parameters suitably
      addtocaptionsspanish{renewcommand{tablename}{Tabla}}
      %%%

      begin{document}



      begin{table}[th]
      footnotesize
      sf
      caption{sf Adultos mayores beneficiarios previsionales según grupo de edades y conformación del hogar, en %}
      label{tab:table32}


      begin{threeparttable}
      begin{tabularx}{textwidth}{@{} l *{15}{Z} @{}}
      toprule toprule
      & multicolumn{3}{c}{65 a 69 años}
      & multicolumn{3}{c}{70 a 74 años}
      & multicolumn{3}{c}{75 a 79 años}
      & multicolumn{3}{c}{80 y más años}
      & multicolumn{3}{c}{Total} \
      cmidrule(lr){2-4} cmidrule(lr){5-7}
      cmidrule(lr){8-10} cmidrule(lr){11-13}
      cmidrule(lr){14-16}
      & 2003 & 2013 & Var.
      & 2003 & 2013 & Var.
      & 2003 & 2013 & Var.
      & 2003 & 2013 & Var.
      & 2003 & 2013 & Var.\
      midrule
      Hogar unipersonal
      & 20,8 & 16,3 & $-$4,5
      & 19,3 & 23,5 & 4,2
      & 30,2 & 29,0 & $-$1,2
      & 35,6 & 31,0 & $-$4.6
      & 26,8 & 24,7 & $-$2,1 \
      Hogar bipersonal - un solo beneficiario
      & 6,3 & 1,8 & $-$4,5
      & 17,0 & 1,3 & $-$15,7
      & 13,1 & 0,2 & $-$12,9
      & 10,0 & 0,7 & $-$9,3
      & 11,9 & 1,0 & $-$10,9 \
      Hogar bipersonal - dos beneficiarios
      & 10,5 & 23,9 & 13,4
      & 20,2 & 26,4 & 6,2
      & 15,7 & 29,6 & 13,9
      & 13,4 & 26,0 & 12,6
      & 15,3 & 26,4 & 11,1 \
      Hogar multipersonal
      & 62,4 & 58,0 & $-$4,4
      & 43,4 & 48,8 & 5,4
      & 41,0 & 41,2 & 0,1
      & 40,9 & 42,3 & 1,4
      & 46,0 & 48,0 & 1,9 \
      \
      multicolumn{16}{l}{Adultos mayores en hogares unipersonalestextsuperscript{a}} \
      Varones & 28,3 & 28,9 & 0,6
      & 21,1 & 27,8 & 6,7
      & 23,1 & 24,1 & 1,0
      & 22,3 & 23,8 & 1,5
      & 23,3 & 25,7 & 2,5 \
      Mujeres & 71,7 & 71,1 & $-$0,6
      & 78,9 & 72,2 & $-$6,7
      & 76,9 & 75,9 & $-$1,0
      & 77,7 & 76,2 & $-$1,5
      & 76,7 & 74,3 & $-$2,5 \
      bottomrule
      end{tabularx}

      begin{tablenotes}
      footnotesize
      smallskip
      item a: Como porcentaje del total de hogares unipersonales conformados por adultos mayores.
      item Fuente: Elaboración propia en base a la EPH.
      end{tablenotes}
      end{threeparttable}

      end{table}

      end{document}








      share













      I'm grateful for the advice I got from this comunity before on how to make columns right aligned in wide tables. But now I cannot domesticate the following table that has 15 columns, some of them contain negative numbers. In addition, I lost the track on how to make the columns right aligned. Suggestions are welcome! Thank you.



      documentclass{book}
      usepackage[spanish]{babel}
      usepackage[utf8]{inputenc} % Required for inputting international characters

      % Paquetes necesarios para las tablas
      usepackage[flushleft]{threeparttable}
      usepackage{array,calc}
      usepackage{varwidth}
      newcolumntype{Z}{>{raggedleftarraybackslash}X}
      usepackage{booktabs,tabularx,ragged2e}
      usepackage{subcaption}
      usepackage{graphicx}
      usepackage{multirow}
      usepackage[margin=1in]{geometry} % choose page size parameters suitably
      addtocaptionsspanish{renewcommand{tablename}{Tabla}}
      %%%

      begin{document}



      begin{table}[th]
      footnotesize
      sf
      caption{sf Adultos mayores beneficiarios previsionales según grupo de edades y conformación del hogar, en %}
      label{tab:table32}


      begin{threeparttable}
      begin{tabularx}{textwidth}{@{} l *{15}{Z} @{}}
      toprule toprule
      & multicolumn{3}{c}{65 a 69 años}
      & multicolumn{3}{c}{70 a 74 años}
      & multicolumn{3}{c}{75 a 79 años}
      & multicolumn{3}{c}{80 y más años}
      & multicolumn{3}{c}{Total} \
      cmidrule(lr){2-4} cmidrule(lr){5-7}
      cmidrule(lr){8-10} cmidrule(lr){11-13}
      cmidrule(lr){14-16}
      & 2003 & 2013 & Var.
      & 2003 & 2013 & Var.
      & 2003 & 2013 & Var.
      & 2003 & 2013 & Var.
      & 2003 & 2013 & Var.\
      midrule
      Hogar unipersonal
      & 20,8 & 16,3 & $-$4,5
      & 19,3 & 23,5 & 4,2
      & 30,2 & 29,0 & $-$1,2
      & 35,6 & 31,0 & $-$4.6
      & 26,8 & 24,7 & $-$2,1 \
      Hogar bipersonal - un solo beneficiario
      & 6,3 & 1,8 & $-$4,5
      & 17,0 & 1,3 & $-$15,7
      & 13,1 & 0,2 & $-$12,9
      & 10,0 & 0,7 & $-$9,3
      & 11,9 & 1,0 & $-$10,9 \
      Hogar bipersonal - dos beneficiarios
      & 10,5 & 23,9 & 13,4
      & 20,2 & 26,4 & 6,2
      & 15,7 & 29,6 & 13,9
      & 13,4 & 26,0 & 12,6
      & 15,3 & 26,4 & 11,1 \
      Hogar multipersonal
      & 62,4 & 58,0 & $-$4,4
      & 43,4 & 48,8 & 5,4
      & 41,0 & 41,2 & 0,1
      & 40,9 & 42,3 & 1,4
      & 46,0 & 48,0 & 1,9 \
      \
      multicolumn{16}{l}{Adultos mayores en hogares unipersonalestextsuperscript{a}} \
      Varones & 28,3 & 28,9 & 0,6
      & 21,1 & 27,8 & 6,7
      & 23,1 & 24,1 & 1,0
      & 22,3 & 23,8 & 1,5
      & 23,3 & 25,7 & 2,5 \
      Mujeres & 71,7 & 71,1 & $-$0,6
      & 78,9 & 72,2 & $-$6,7
      & 76,9 & 75,9 & $-$1,0
      & 77,7 & 76,2 & $-$1,5
      & 76,7 & 74,3 & $-$2,5 \
      bottomrule
      end{tabularx}

      begin{tablenotes}
      footnotesize
      smallskip
      item a: Como porcentaje del total de hogares unipersonales conformados por adultos mayores.
      item Fuente: Elaboración propia en base a la EPH.
      end{tablenotes}
      end{threeparttable}

      end{table}

      end{document}






      tables horizontal-alignment





      share












      share










      share



      share










      asked 4 mins ago









      eagu_999

      304




      304



























          active

          oldest

          votes











          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%2f467053%2fhow-to-make-columns-right-aligned-in-a-wide-table%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          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%2f467053%2fhow-to-make-columns-right-aligned-in-a-wide-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

          Accessing regular linux commands in Huawei's Dopra Linux

          Can't connect RFCOMM socket: Host is down

          Kernel panic - not syncing: Fatal Exception in Interrupt