Table content alignment to centre using tabularWhy are my Images not correctly centered?Column with fixed width and centre alignmentAlignment inside the table in tabularHow to create a table with fixed-width cells and use cellcolor and multicolumn to create time bars? Or: How to substitute ganttbar with tabular?Improper alignment in tabular environment when using xcolor table optionspacing and alignment using array in a table with tabular setupTabular alignment S tableCan't centre tabular tableVertically-centre content of a Table

Would this system work to purify water?

Singleton Design Pattern implementation in a not traditional way

How should I face my manager if I make a mistake because a senior coworker explained something incorrectly to me?

I have a player who yells

Who was president?

If the first law of thermodynamics ensures conservation of energy, why does it allow systems to lose energy?

Prove your innocence

Does travel insurance for short flight delays exist?

Architectural feasibility of a tiered circular stone keep

Is a player able to change alignment midway through an adventure?

Numbers Decrease while Letters Increase

Using `With[...]` with a list specification as a variable

Mathematical uses of string theory

how do you harvest carrots in creative mode

Cross-referencing enumerate item

Defense against attacks using dictionaries

Is there any way to keep a player from killing an NPC?

Attaching a piece of wood to a necklace without drilling

Are modern clipless shoes and pedals that much better than toe clips and straps?

What does どうかと思う mean?

What magic extends life or grants immortality?

Is using a hyperlink to close a modal a poor design decision?

How would one country purchase another?

Co-author responds to email by mistake cc'ing the EiC



Table content alignment to centre using tabular


Why are my Images not correctly centered?Column with fixed width and centre alignmentAlignment inside the table in tabularHow to create a table with fixed-width cells and use cellcolor and multicolumn to create time bars? Or: How to substitute ganttbar with tabular?Improper alignment in tabular environment when using xcolor table optionspacing and alignment using array in a table with tabular setupTabular alignment S tableCan't centre tabular tableVertically-centre content of a Table






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








3















I wish to put the second and third columns in equal length and in center.



documentclassarticle
usepackagebooktabs

begindocument

begintable[!ht]
%begintabularxtextwidth@Y*3W@
centering
begintabularccc
toprule
& multicolumn2ctextbfTesting Testing Testin \
& multicolumn2ctextbfMaking into Secondline (%) \
cmidrule2-3
& small textbfAA
& small textbfBB \
midrule
Test 1 & 33 & 73 \
Test 2 & 57 & 73 \
Test 2 & 57 & 73 \
Test 2 & 57 & 73 \
Test 2 & 57 & 73 \
Test 2 & 57 & 73 \
Test 2 & 57 & 73 \
bottomrule
endtabular

endtable

enddocument


Outcome:



enter image description here



I wish to put the second and third columns in equal length and in center.



I had tried :



 begintabularccc









share|improve this question


























  • I suppose you means second and third columns? What width?

    – Bernard
    Aug 10 at 22:30











  • @Bernard, yes, columns. I will edit my questions again. The width should be same for both second and third columns.

    – aan
    Aug 10 at 22:31











  • What will be the real content of these columns?

    – Bernard
    Aug 10 at 22:34











  • @Bernard, it is just percentages of number (for example: 50%, 100%, 40%)

    – aan
    Aug 10 at 22:41

















3















I wish to put the second and third columns in equal length and in center.



documentclassarticle
usepackagebooktabs

begindocument

begintable[!ht]
%begintabularxtextwidth@Y*3W@
centering
begintabularccc
toprule
& multicolumn2ctextbfTesting Testing Testin \
& multicolumn2ctextbfMaking into Secondline (%) \
cmidrule2-3
& small textbfAA
& small textbfBB \
midrule
Test 1 & 33 & 73 \
Test 2 & 57 & 73 \
Test 2 & 57 & 73 \
Test 2 & 57 & 73 \
Test 2 & 57 & 73 \
Test 2 & 57 & 73 \
Test 2 & 57 & 73 \
bottomrule
endtabular

endtable

enddocument


Outcome:



enter image description here



I wish to put the second and third columns in equal length and in center.



I had tried :



 begintabularccc









share|improve this question


























  • I suppose you means second and third columns? What width?

    – Bernard
    Aug 10 at 22:30











  • @Bernard, yes, columns. I will edit my questions again. The width should be same for both second and third columns.

    – aan
    Aug 10 at 22:31











  • What will be the real content of these columns?

    – Bernard
    Aug 10 at 22:34











  • @Bernard, it is just percentages of number (for example: 50%, 100%, 40%)

    – aan
    Aug 10 at 22:41













3












3








3








I wish to put the second and third columns in equal length and in center.



documentclassarticle
usepackagebooktabs

begindocument

begintable[!ht]
%begintabularxtextwidth@Y*3W@
centering
begintabularccc
toprule
& multicolumn2ctextbfTesting Testing Testin \
& multicolumn2ctextbfMaking into Secondline (%) \
cmidrule2-3
& small textbfAA
& small textbfBB \
midrule
Test 1 & 33 & 73 \
Test 2 & 57 & 73 \
Test 2 & 57 & 73 \
Test 2 & 57 & 73 \
Test 2 & 57 & 73 \
Test 2 & 57 & 73 \
Test 2 & 57 & 73 \
bottomrule
endtabular

endtable

enddocument


Outcome:



enter image description here



I wish to put the second and third columns in equal length and in center.



I had tried :



 begintabularccc









share|improve this question
















I wish to put the second and third columns in equal length and in center.



documentclassarticle
usepackagebooktabs

begindocument

begintable[!ht]
%begintabularxtextwidth@Y*3W@
centering
begintabularccc
toprule
& multicolumn2ctextbfTesting Testing Testin \
& multicolumn2ctextbfMaking into Secondline (%) \
cmidrule2-3
& small textbfAA
& small textbfBB \
midrule
Test 1 & 33 & 73 \
Test 2 & 57 & 73 \
Test 2 & 57 & 73 \
Test 2 & 57 & 73 \
Test 2 & 57 & 73 \
Test 2 & 57 & 73 \
Test 2 & 57 & 73 \
bottomrule
endtabular

endtable

enddocument


Outcome:



enter image description here



I wish to put the second and third columns in equal length and in center.



I had tried :



 begintabularccc






tables horizontal-alignment






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 10 at 22:51









egreg

763k90 gold badges1995 silver badges3342 bronze badges




763k90 gold badges1995 silver badges3342 bronze badges










asked Aug 10 at 22:22









aanaan

2427 bronze badges




2427 bronze badges















  • I suppose you means second and third columns? What width?

    – Bernard
    Aug 10 at 22:30











  • @Bernard, yes, columns. I will edit my questions again. The width should be same for both second and third columns.

    – aan
    Aug 10 at 22:31











  • What will be the real content of these columns?

    – Bernard
    Aug 10 at 22:34











  • @Bernard, it is just percentages of number (for example: 50%, 100%, 40%)

    – aan
    Aug 10 at 22:41

















  • I suppose you means second and third columns? What width?

    – Bernard
    Aug 10 at 22:30











  • @Bernard, yes, columns. I will edit my questions again. The width should be same for both second and third columns.

    – aan
    Aug 10 at 22:31











  • What will be the real content of these columns?

    – Bernard
    Aug 10 at 22:34











  • @Bernard, it is just percentages of number (for example: 50%, 100%, 40%)

    – aan
    Aug 10 at 22:41
















I suppose you means second and third columns? What width?

– Bernard
Aug 10 at 22:30





I suppose you means second and third columns? What width?

– Bernard
Aug 10 at 22:30













@Bernard, yes, columns. I will edit my questions again. The width should be same for both second and third columns.

– aan
Aug 10 at 22:31





@Bernard, yes, columns. I will edit my questions again. The width should be same for both second and third columns.

– aan
Aug 10 at 22:31













What will be the real content of these columns?

– Bernard
Aug 10 at 22:34





What will be the real content of these columns?

– Bernard
Aug 10 at 22:34













@Bernard, it is just percentages of number (for example: 50%, 100%, 40%)

– aan
Aug 10 at 22:41





@Bernard, it is just percentages of number (for example: 50%, 100%, 40%)

– aan
Aug 10 at 22:41










3 Answers
3






active

oldest

votes


















3















Here is a way with the help of parbox



documentclassarticle
usepackagebooktabs

begindocument

begintable[!ht]
%begintabularxtextwidth@Y*3W@
centering
begintabularccc
toprule
& multicolumn2ctextbfTesting Testing Testin \
& multicolumn2ctextbfMaking into Secondline (%) \
cmidrule2-3
& parbox3cmsmallhfiltextbfAAhfill
& parbox3cmsmallhfiltextbfBBhfill \
midrule
Test 1 & 33 & 73 \
Test 2 & 57 & 73 \
Test 2 & 57 & 73 \
Test 2 & 57 & 73 \
Test 2 & 57 & 73 \
Test 2 & 57 & 73 \
Test 2 & 57 & 73 \
bottomrule
endtabular

endtable

enddocument


enter image description here






share|improve this answer
































    2















    Here is a possible solution, based on siunitx to have a nice alignment of numbers (centred right-aligned). Non-numbers in S columns have to be surrounded by a pair of braces and are automatically centred. Furthermore, the width of S columns can be chosen. This solution also relies on makecell, which allows for line breaks in standard cells, and a common formatting of the arguments of the makecell and thead commands.



    documentclassarticle
    usepackagearray
    usepackagebooktabs, makecell
    renewcommandtheadfontsmallbfseries
    usepackagesiunitx

    begindocument

    begintable[!ht]
    centering
    sisetuptable-format=3.0, table-number-alignment=center, table-column-width=1.5cm
    begintabularcSS
    toprule
    & multicolumn2csmallbfseries Testing Testing Testin \
    & multicolumn2ctheadmakebox[0pt]Making into Secondline\ (%) \
    cmidrule2-3
    &small textbfAA
    & smalltextbfBB \
    midrule
    Test 1 & 33 & 73 \
    Test 2 & 57 & 73 \
    Test 2 & 57 & 73 \
    Test 2 & 57 & 73 \
    Test 2 & 57 & 73 \
    Test 2 & 57 & 73 \
    Test 2 & 57 & 73 \
    bottomrule
    endtabular
    endtable

    enddocument


    enter image description here






    share|improve this answer






















    • 1





      My clipboard manager struck again! Thank you for pointing it! I'll fix that within seconds.

      – Bernard
      Aug 10 at 23:12


















    1















    This make columns "Z", centered with exactly the half width of the longest header line. You have only to say to LateX what is the width of that header line, before of each tabular, width settowidth:



    documentclassarticle
    usepackagebooktabs,array
    newlengthxxx % suggestion: change "xxx" for something meaningful
    newcolumntypeZ>hfilp.5xxx
    begindocument

    settowidthxxxtextbfMaking into Secondline (%)

    begintabularcZZ toprule
    & multicolumn2ctextbfTesting Testing Testin \
    & multicolumn2ctextbfMaking into Secondline (%) \cmidrule2-3
    & small textbfAA & small textbfBB \midrule
    Test 1 & 33 & 73 \
    Test 2 & 57 & 73 \
    Test 2 & 57 & 73 \
    Test 2 & 57 & 73 \
    Test 2 & 57 & 73 \
    Test 2 & 57 & 73 \
    Test 2 & 57 & 73 \bottomrule
    endtabular

    enddocument


    mwe






    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%2f503718%2ftable-content-alignment-to-centre-using-tabular%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      3















      Here is a way with the help of parbox



      documentclassarticle
      usepackagebooktabs

      begindocument

      begintable[!ht]
      %begintabularxtextwidth@Y*3W@
      centering
      begintabularccc
      toprule
      & multicolumn2ctextbfTesting Testing Testin \
      & multicolumn2ctextbfMaking into Secondline (%) \
      cmidrule2-3
      & parbox3cmsmallhfiltextbfAAhfill
      & parbox3cmsmallhfiltextbfBBhfill \
      midrule
      Test 1 & 33 & 73 \
      Test 2 & 57 & 73 \
      Test 2 & 57 & 73 \
      Test 2 & 57 & 73 \
      Test 2 & 57 & 73 \
      Test 2 & 57 & 73 \
      Test 2 & 57 & 73 \
      bottomrule
      endtabular

      endtable

      enddocument


      enter image description here






      share|improve this answer





























        3















        Here is a way with the help of parbox



        documentclassarticle
        usepackagebooktabs

        begindocument

        begintable[!ht]
        %begintabularxtextwidth@Y*3W@
        centering
        begintabularccc
        toprule
        & multicolumn2ctextbfTesting Testing Testin \
        & multicolumn2ctextbfMaking into Secondline (%) \
        cmidrule2-3
        & parbox3cmsmallhfiltextbfAAhfill
        & parbox3cmsmallhfiltextbfBBhfill \
        midrule
        Test 1 & 33 & 73 \
        Test 2 & 57 & 73 \
        Test 2 & 57 & 73 \
        Test 2 & 57 & 73 \
        Test 2 & 57 & 73 \
        Test 2 & 57 & 73 \
        Test 2 & 57 & 73 \
        bottomrule
        endtabular

        endtable

        enddocument


        enter image description here






        share|improve this answer



























          3














          3










          3









          Here is a way with the help of parbox



          documentclassarticle
          usepackagebooktabs

          begindocument

          begintable[!ht]
          %begintabularxtextwidth@Y*3W@
          centering
          begintabularccc
          toprule
          & multicolumn2ctextbfTesting Testing Testin \
          & multicolumn2ctextbfMaking into Secondline (%) \
          cmidrule2-3
          & parbox3cmsmallhfiltextbfAAhfill
          & parbox3cmsmallhfiltextbfBBhfill \
          midrule
          Test 1 & 33 & 73 \
          Test 2 & 57 & 73 \
          Test 2 & 57 & 73 \
          Test 2 & 57 & 73 \
          Test 2 & 57 & 73 \
          Test 2 & 57 & 73 \
          Test 2 & 57 & 73 \
          bottomrule
          endtabular

          endtable

          enddocument


          enter image description here






          share|improve this answer













          Here is a way with the help of parbox



          documentclassarticle
          usepackagebooktabs

          begindocument

          begintable[!ht]
          %begintabularxtextwidth@Y*3W@
          centering
          begintabularccc
          toprule
          & multicolumn2ctextbfTesting Testing Testin \
          & multicolumn2ctextbfMaking into Secondline (%) \
          cmidrule2-3
          & parbox3cmsmallhfiltextbfAAhfill
          & parbox3cmsmallhfiltextbfBBhfill \
          midrule
          Test 1 & 33 & 73 \
          Test 2 & 57 & 73 \
          Test 2 & 57 & 73 \
          Test 2 & 57 & 73 \
          Test 2 & 57 & 73 \
          Test 2 & 57 & 73 \
          Test 2 & 57 & 73 \
          bottomrule
          endtabular

          endtable

          enddocument


          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Aug 10 at 22:50









          koleygrkoleygr

          14.5k1 gold badge10 silver badges40 bronze badges




          14.5k1 gold badge10 silver badges40 bronze badges


























              2















              Here is a possible solution, based on siunitx to have a nice alignment of numbers (centred right-aligned). Non-numbers in S columns have to be surrounded by a pair of braces and are automatically centred. Furthermore, the width of S columns can be chosen. This solution also relies on makecell, which allows for line breaks in standard cells, and a common formatting of the arguments of the makecell and thead commands.



              documentclassarticle
              usepackagearray
              usepackagebooktabs, makecell
              renewcommandtheadfontsmallbfseries
              usepackagesiunitx

              begindocument

              begintable[!ht]
              centering
              sisetuptable-format=3.0, table-number-alignment=center, table-column-width=1.5cm
              begintabularcSS
              toprule
              & multicolumn2csmallbfseries Testing Testing Testin \
              & multicolumn2ctheadmakebox[0pt]Making into Secondline\ (%) \
              cmidrule2-3
              &small textbfAA
              & smalltextbfBB \
              midrule
              Test 1 & 33 & 73 \
              Test 2 & 57 & 73 \
              Test 2 & 57 & 73 \
              Test 2 & 57 & 73 \
              Test 2 & 57 & 73 \
              Test 2 & 57 & 73 \
              Test 2 & 57 & 73 \
              bottomrule
              endtabular
              endtable

              enddocument


              enter image description here






              share|improve this answer






















              • 1





                My clipboard manager struck again! Thank you for pointing it! I'll fix that within seconds.

                – Bernard
                Aug 10 at 23:12















              2















              Here is a possible solution, based on siunitx to have a nice alignment of numbers (centred right-aligned). Non-numbers in S columns have to be surrounded by a pair of braces and are automatically centred. Furthermore, the width of S columns can be chosen. This solution also relies on makecell, which allows for line breaks in standard cells, and a common formatting of the arguments of the makecell and thead commands.



              documentclassarticle
              usepackagearray
              usepackagebooktabs, makecell
              renewcommandtheadfontsmallbfseries
              usepackagesiunitx

              begindocument

              begintable[!ht]
              centering
              sisetuptable-format=3.0, table-number-alignment=center, table-column-width=1.5cm
              begintabularcSS
              toprule
              & multicolumn2csmallbfseries Testing Testing Testin \
              & multicolumn2ctheadmakebox[0pt]Making into Secondline\ (%) \
              cmidrule2-3
              &small textbfAA
              & smalltextbfBB \
              midrule
              Test 1 & 33 & 73 \
              Test 2 & 57 & 73 \
              Test 2 & 57 & 73 \
              Test 2 & 57 & 73 \
              Test 2 & 57 & 73 \
              Test 2 & 57 & 73 \
              Test 2 & 57 & 73 \
              bottomrule
              endtabular
              endtable

              enddocument


              enter image description here






              share|improve this answer






















              • 1





                My clipboard manager struck again! Thank you for pointing it! I'll fix that within seconds.

                – Bernard
                Aug 10 at 23:12













              2














              2










              2









              Here is a possible solution, based on siunitx to have a nice alignment of numbers (centred right-aligned). Non-numbers in S columns have to be surrounded by a pair of braces and are automatically centred. Furthermore, the width of S columns can be chosen. This solution also relies on makecell, which allows for line breaks in standard cells, and a common formatting of the arguments of the makecell and thead commands.



              documentclassarticle
              usepackagearray
              usepackagebooktabs, makecell
              renewcommandtheadfontsmallbfseries
              usepackagesiunitx

              begindocument

              begintable[!ht]
              centering
              sisetuptable-format=3.0, table-number-alignment=center, table-column-width=1.5cm
              begintabularcSS
              toprule
              & multicolumn2csmallbfseries Testing Testing Testin \
              & multicolumn2ctheadmakebox[0pt]Making into Secondline\ (%) \
              cmidrule2-3
              &small textbfAA
              & smalltextbfBB \
              midrule
              Test 1 & 33 & 73 \
              Test 2 & 57 & 73 \
              Test 2 & 57 & 73 \
              Test 2 & 57 & 73 \
              Test 2 & 57 & 73 \
              Test 2 & 57 & 73 \
              Test 2 & 57 & 73 \
              bottomrule
              endtabular
              endtable

              enddocument


              enter image description here






              share|improve this answer















              Here is a possible solution, based on siunitx to have a nice alignment of numbers (centred right-aligned). Non-numbers in S columns have to be surrounded by a pair of braces and are automatically centred. Furthermore, the width of S columns can be chosen. This solution also relies on makecell, which allows for line breaks in standard cells, and a common formatting of the arguments of the makecell and thead commands.



              documentclassarticle
              usepackagearray
              usepackagebooktabs, makecell
              renewcommandtheadfontsmallbfseries
              usepackagesiunitx

              begindocument

              begintable[!ht]
              centering
              sisetuptable-format=3.0, table-number-alignment=center, table-column-width=1.5cm
              begintabularcSS
              toprule
              & multicolumn2csmallbfseries Testing Testing Testin \
              & multicolumn2ctheadmakebox[0pt]Making into Secondline\ (%) \
              cmidrule2-3
              &small textbfAA
              & smalltextbfBB \
              midrule
              Test 1 & 33 & 73 \
              Test 2 & 57 & 73 \
              Test 2 & 57 & 73 \
              Test 2 & 57 & 73 \
              Test 2 & 57 & 73 \
              Test 2 & 57 & 73 \
              Test 2 & 57 & 73 \
              bottomrule
              endtabular
              endtable

              enddocument


              enter image description here







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Aug 10 at 23:14

























              answered Aug 10 at 23:06









              BernardBernard

              189k7 gold badges85 silver badges224 bronze badges




              189k7 gold badges85 silver badges224 bronze badges










              • 1





                My clipboard manager struck again! Thank you for pointing it! I'll fix that within seconds.

                – Bernard
                Aug 10 at 23:12












              • 1





                My clipboard manager struck again! Thank you for pointing it! I'll fix that within seconds.

                – Bernard
                Aug 10 at 23:12







              1




              1





              My clipboard manager struck again! Thank you for pointing it! I'll fix that within seconds.

              – Bernard
              Aug 10 at 23:12





              My clipboard manager struck again! Thank you for pointing it! I'll fix that within seconds.

              – Bernard
              Aug 10 at 23:12











              1















              This make columns "Z", centered with exactly the half width of the longest header line. You have only to say to LateX what is the width of that header line, before of each tabular, width settowidth:



              documentclassarticle
              usepackagebooktabs,array
              newlengthxxx % suggestion: change "xxx" for something meaningful
              newcolumntypeZ>hfilp.5xxx
              begindocument

              settowidthxxxtextbfMaking into Secondline (%)

              begintabularcZZ toprule
              & multicolumn2ctextbfTesting Testing Testin \
              & multicolumn2ctextbfMaking into Secondline (%) \cmidrule2-3
              & small textbfAA & small textbfBB \midrule
              Test 1 & 33 & 73 \
              Test 2 & 57 & 73 \
              Test 2 & 57 & 73 \
              Test 2 & 57 & 73 \
              Test 2 & 57 & 73 \
              Test 2 & 57 & 73 \
              Test 2 & 57 & 73 \bottomrule
              endtabular

              enddocument


              mwe






              share|improve this answer





























                1















                This make columns "Z", centered with exactly the half width of the longest header line. You have only to say to LateX what is the width of that header line, before of each tabular, width settowidth:



                documentclassarticle
                usepackagebooktabs,array
                newlengthxxx % suggestion: change "xxx" for something meaningful
                newcolumntypeZ>hfilp.5xxx
                begindocument

                settowidthxxxtextbfMaking into Secondline (%)

                begintabularcZZ toprule
                & multicolumn2ctextbfTesting Testing Testin \
                & multicolumn2ctextbfMaking into Secondline (%) \cmidrule2-3
                & small textbfAA & small textbfBB \midrule
                Test 1 & 33 & 73 \
                Test 2 & 57 & 73 \
                Test 2 & 57 & 73 \
                Test 2 & 57 & 73 \
                Test 2 & 57 & 73 \
                Test 2 & 57 & 73 \
                Test 2 & 57 & 73 \bottomrule
                endtabular

                enddocument


                mwe






                share|improve this answer



























                  1














                  1










                  1









                  This make columns "Z", centered with exactly the half width of the longest header line. You have only to say to LateX what is the width of that header line, before of each tabular, width settowidth:



                  documentclassarticle
                  usepackagebooktabs,array
                  newlengthxxx % suggestion: change "xxx" for something meaningful
                  newcolumntypeZ>hfilp.5xxx
                  begindocument

                  settowidthxxxtextbfMaking into Secondline (%)

                  begintabularcZZ toprule
                  & multicolumn2ctextbfTesting Testing Testin \
                  & multicolumn2ctextbfMaking into Secondline (%) \cmidrule2-3
                  & small textbfAA & small textbfBB \midrule
                  Test 1 & 33 & 73 \
                  Test 2 & 57 & 73 \
                  Test 2 & 57 & 73 \
                  Test 2 & 57 & 73 \
                  Test 2 & 57 & 73 \
                  Test 2 & 57 & 73 \
                  Test 2 & 57 & 73 \bottomrule
                  endtabular

                  enddocument


                  mwe






                  share|improve this answer













                  This make columns "Z", centered with exactly the half width of the longest header line. You have only to say to LateX what is the width of that header line, before of each tabular, width settowidth:



                  documentclassarticle
                  usepackagebooktabs,array
                  newlengthxxx % suggestion: change "xxx" for something meaningful
                  newcolumntypeZ>hfilp.5xxx
                  begindocument

                  settowidthxxxtextbfMaking into Secondline (%)

                  begintabularcZZ toprule
                  & multicolumn2ctextbfTesting Testing Testin \
                  & multicolumn2ctextbfMaking into Secondline (%) \cmidrule2-3
                  & small textbfAA & small textbfBB \midrule
                  Test 1 & 33 & 73 \
                  Test 2 & 57 & 73 \
                  Test 2 & 57 & 73 \
                  Test 2 & 57 & 73 \
                  Test 2 & 57 & 73 \
                  Test 2 & 57 & 73 \
                  Test 2 & 57 & 73 \bottomrule
                  endtabular

                  enddocument


                  mwe







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Aug 11 at 9:03









                  FranFran

                  56.2k6 gold badges123 silver badges190 bronze badges




                  56.2k6 gold badges123 silver badges190 bronze badges






























                      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%2f503718%2ftable-content-alignment-to-centre-using-tabular%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

                      Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

                      Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                      Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form