Centre cell vertically in tabularx across multiple multiline rows Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)Vertical alignment in tabularx X column typeCenter vertically in tabularx with multiple font size and arraystretchVertically center text across two rowsVertically align multirow in tabularx environmenttabu package - gaps in vertical linesBreak cell into multiple rowsVertically centered cell with rotatebox and tabularxCentre column contents in tabularxHow to vertically centre a cell spanning multiple rows with the p column typeCentre cell contents verticallyCentre cell vertically in tabularx

New Order #6: Easter Egg

How to make an animal which can only breed for a certain number of generations?

What does Sonny Burch mean by, "S.H.I.E.L.D. and HYDRA don't even exist anymore"?

How to get a flat-head nail out of a piece of wood?

Why can't fire hurt Daenerys but it did to Jon Snow in season 1?

Why complex landing gears are used instead of simple, reliable and light weight muscle wire or shape memory alloys?

What did Turing mean when saying that "machines cannot give rise to surprises" is due to a fallacy?

Inverse square law not accurate for non-point masses?

Understanding piped commands in GNU/Linux

"Destructive power" carried by a B-52?

Changing order of draw operation in PGFPlots

How do you cope with tons of web fonts when copying and pasting from web pages?

As a dual citizen, my US passport will expire one day after traveling to the US. Will this work?

Weaponising the Grasp-at-a-Distance spell

How to name indistinguishable henchmen in a screenplay?

By what mechanism was the 2017 UK General Election called?

Can I take recommendation from someone I met at a conference?

draw a pulley system

.bashrc alias for a command with fixed second parameter

Should man-made satellites feature an intelligent inverted "cow catcher"?

Improvising over quartal voicings

3D Masyu - A Die

How do I say "this must not happen"?

Centre cell vertically in tabularx across multiple multiline rows



Centre cell vertically in tabularx across multiple multiline rows



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)Vertical alignment in tabularx X column typeCenter vertically in tabularx with multiple font size and arraystretchVertically center text across two rowsVertically align multirow in tabularx environmenttabu package - gaps in vertical linesBreak cell into multiple rowsVertically centered cell with rotatebox and tabularxCentre column contents in tabularxHow to vertically centre a cell spanning multiple rows with the p column typeCentre cell contents verticallyCentre cell vertically in tabularx










2















Consider this example:



documentclassreport
usepackagetabularx
usepackagelipsum
usepackagemultirow
renewcommandtabularxcolumn[1]m#1
begindocument
begintabularx0.5linewidthllX
multirow2*A & B & lipsum[1][1-2] \
& C & lipsum[2][1-3]\
endtabularx
enddocument


The output is



enter image description here



I have used Vertical alignment in tabularx X column type to centre cells vertically.



However, I am not pleased the way "A" is centred. It uses multirow. How to centre "A" vertically in the middle of the table?



Solution that avoids the use of multirow is also accepted.










share|improve this question
























  • Maybe you can try with multirow8*A.

    – leandriis
    1 hour ago












  • Since you made m the underlying column type, since the cells in column 3 occupy 12 rows in all, and since one half of 12 is 6, you should replace multirow2*A with multirow6*A.

    – Mico
    1 hour ago












  • @Mico: Wouldn't one typically use multirow12 in order to vertically center a cell adjacent to a cell that contains 12 lines of text? However, in the OP's case the redefinition of the X type column using renewcommandtabularxcolumn[1]m#1 seems to interfere with that.

    – leandriis
    1 hour ago











  • @leandriis, then I need to manually count rows. So laborious when dealing with many tables, changing text.

    – Viesturs
    1 hour ago











  • @leandriis - Indeed, if the renewcommandtabularxcolumn[1]m#1 directive weren't there, one would have to use 12, not 6, as the first argument of multirow.

    – Mico
    1 hour ago















2















Consider this example:



documentclassreport
usepackagetabularx
usepackagelipsum
usepackagemultirow
renewcommandtabularxcolumn[1]m#1
begindocument
begintabularx0.5linewidthllX
multirow2*A & B & lipsum[1][1-2] \
& C & lipsum[2][1-3]\
endtabularx
enddocument


The output is



enter image description here



I have used Vertical alignment in tabularx X column type to centre cells vertically.



However, I am not pleased the way "A" is centred. It uses multirow. How to centre "A" vertically in the middle of the table?



Solution that avoids the use of multirow is also accepted.










share|improve this question
























  • Maybe you can try with multirow8*A.

    – leandriis
    1 hour ago












  • Since you made m the underlying column type, since the cells in column 3 occupy 12 rows in all, and since one half of 12 is 6, you should replace multirow2*A with multirow6*A.

    – Mico
    1 hour ago












  • @Mico: Wouldn't one typically use multirow12 in order to vertically center a cell adjacent to a cell that contains 12 lines of text? However, in the OP's case the redefinition of the X type column using renewcommandtabularxcolumn[1]m#1 seems to interfere with that.

    – leandriis
    1 hour ago











  • @leandriis, then I need to manually count rows. So laborious when dealing with many tables, changing text.

    – Viesturs
    1 hour ago











  • @leandriis - Indeed, if the renewcommandtabularxcolumn[1]m#1 directive weren't there, one would have to use 12, not 6, as the first argument of multirow.

    – Mico
    1 hour ago













2












2








2


0






Consider this example:



documentclassreport
usepackagetabularx
usepackagelipsum
usepackagemultirow
renewcommandtabularxcolumn[1]m#1
begindocument
begintabularx0.5linewidthllX
multirow2*A & B & lipsum[1][1-2] \
& C & lipsum[2][1-3]\
endtabularx
enddocument


The output is



enter image description here



I have used Vertical alignment in tabularx X column type to centre cells vertically.



However, I am not pleased the way "A" is centred. It uses multirow. How to centre "A" vertically in the middle of the table?



Solution that avoids the use of multirow is also accepted.










share|improve this question
















Consider this example:



documentclassreport
usepackagetabularx
usepackagelipsum
usepackagemultirow
renewcommandtabularxcolumn[1]m#1
begindocument
begintabularx0.5linewidthllX
multirow2*A & B & lipsum[1][1-2] \
& C & lipsum[2][1-3]\
endtabularx
enddocument


The output is



enter image description here



I have used Vertical alignment in tabularx X column type to centre cells vertically.



However, I am not pleased the way "A" is centred. It uses multirow. How to centre "A" vertically in the middle of the table?



Solution that avoids the use of multirow is also accepted.







tables vertical-alignment tabularx multirow






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 50 mins ago







Viesturs

















asked 1 hour ago









ViestursViesturs

2,06241327




2,06241327












  • Maybe you can try with multirow8*A.

    – leandriis
    1 hour ago












  • Since you made m the underlying column type, since the cells in column 3 occupy 12 rows in all, and since one half of 12 is 6, you should replace multirow2*A with multirow6*A.

    – Mico
    1 hour ago












  • @Mico: Wouldn't one typically use multirow12 in order to vertically center a cell adjacent to a cell that contains 12 lines of text? However, in the OP's case the redefinition of the X type column using renewcommandtabularxcolumn[1]m#1 seems to interfere with that.

    – leandriis
    1 hour ago











  • @leandriis, then I need to manually count rows. So laborious when dealing with many tables, changing text.

    – Viesturs
    1 hour ago











  • @leandriis - Indeed, if the renewcommandtabularxcolumn[1]m#1 directive weren't there, one would have to use 12, not 6, as the first argument of multirow.

    – Mico
    1 hour ago

















  • Maybe you can try with multirow8*A.

    – leandriis
    1 hour ago












  • Since you made m the underlying column type, since the cells in column 3 occupy 12 rows in all, and since one half of 12 is 6, you should replace multirow2*A with multirow6*A.

    – Mico
    1 hour ago












  • @Mico: Wouldn't one typically use multirow12 in order to vertically center a cell adjacent to a cell that contains 12 lines of text? However, in the OP's case the redefinition of the X type column using renewcommandtabularxcolumn[1]m#1 seems to interfere with that.

    – leandriis
    1 hour ago











  • @leandriis, then I need to manually count rows. So laborious when dealing with many tables, changing text.

    – Viesturs
    1 hour ago











  • @leandriis - Indeed, if the renewcommandtabularxcolumn[1]m#1 directive weren't there, one would have to use 12, not 6, as the first argument of multirow.

    – Mico
    1 hour ago
















Maybe you can try with multirow8*A.

– leandriis
1 hour ago






Maybe you can try with multirow8*A.

– leandriis
1 hour ago














Since you made m the underlying column type, since the cells in column 3 occupy 12 rows in all, and since one half of 12 is 6, you should replace multirow2*A with multirow6*A.

– Mico
1 hour ago






Since you made m the underlying column type, since the cells in column 3 occupy 12 rows in all, and since one half of 12 is 6, you should replace multirow2*A with multirow6*A.

– Mico
1 hour ago














@Mico: Wouldn't one typically use multirow12 in order to vertically center a cell adjacent to a cell that contains 12 lines of text? However, in the OP's case the redefinition of the X type column using renewcommandtabularxcolumn[1]m#1 seems to interfere with that.

– leandriis
1 hour ago





@Mico: Wouldn't one typically use multirow12 in order to vertically center a cell adjacent to a cell that contains 12 lines of text? However, in the OP's case the redefinition of the X type column using renewcommandtabularxcolumn[1]m#1 seems to interfere with that.

– leandriis
1 hour ago













@leandriis, then I need to manually count rows. So laborious when dealing with many tables, changing text.

– Viesturs
1 hour ago





@leandriis, then I need to manually count rows. So laborious when dealing with many tables, changing text.

– Viesturs
1 hour ago













@leandriis - Indeed, if the renewcommandtabularxcolumn[1]m#1 directive weren't there, one would have to use 12, not 6, as the first argument of multirow.

– Mico
1 hour ago





@leandriis - Indeed, if the renewcommandtabularxcolumn[1]m#1 directive weren't there, one would have to use 12, not 6, as the first argument of multirow.

– Mico
1 hour ago










3 Answers
3






active

oldest

votes


















3














As Ulrike said in a comment, to avoid manual adjustment, nesting tabulars could be a solution.



I would put a tabular with an m column of appropriate width in the main tabular.



I added the lines just to show the "A" is vertically centered.



documentclassreport
usepackagetabularx
usepackagearray
usepackagelipsum
begindocument
noindentbegintabular
hline
A &
begintabular@lm.352linewidth@
B & lipsum[1][1-2]\
C & lipsum[2][1-3]\
endtabular\
hline
endtabular

vspace4exnoindentbegintabularx.5linewidthllX
hline
A & B & Just for benchmark\
hline
endtabularx
enddocument


enter image description here






share|improve this answer

























  • In case of multiple multirow cells nesting in a nesting would be required.

    – Viesturs
    36 mins ago











  • @Viesturs Yes, it may be

    – CarLaTeX
    35 mins ago


















3














Here is a possibe solution using a minipage and a tabularx:



documentclassreport
usepackagetabularx
usepackagelipsum
usepackagemultirow
renewcommandtabularxcolumn[1]m#1
usepackagecalc

begindocument

beginminipage2em
A
endminipage%
begintabularx0.5linewidth-2emlX
B & lipsum[1][1-2] \
C & lipsum[2][1-3]\
endtabularx

enddocument


enter image description here






share|improve this answer






























    2














    In this case you can use a 1-row multicolumn as the baseline of the m-column is there. In other cases you will have to use the vmode-option described in the documentation. Imho while multirow works okay with 1-line cells it is imho rather a pain with m- and p-columns and I use it seldom.



    documentclassreport
    usepackagetabularx
    usepackagelipsum
    usepackagemultirow
    begindocument
    % with X as p-column 5 works:
    begintabularx0.5linewidthllX
    multirow5*A & B & lipsum[1][1-2] \
    & C & lipsum[2][1-3]\
    endtabularx

    %X as m-column:
    renewcommandtabularxcolumn[1]m#1
    begintabularx0.5linewidthllX
    multirow1*A & B & lipsum[1][1-2] \
    & C & lipsum[2][1-3]\
    endtabularx
    enddocument


    enter image description here



    To center the A over both cells use a value of 8.5 or 9 works (that's the number of lines below the baseline of the first cell.



    documentclassreport
    usepackagetabularx
    usepackagelipsum
    usepackagemultirow
    renewcommandtabularxcolumn[1]m#1
    begindocument
    begintabularx0.5linewidthllX
    multirow9*A & B & lipsum[1][1-2] \
    & C & lipsum[2][1-3]\
    endtabularx
    enddocument


    enter image description here






    share|improve this answer

























    • Where is the improvement? Apparently I was not clear in my question, but by nicely I mean "A" centred vertically in the middle of the table. I updated my question.

      – Viesturs
      1 hour ago












    • Ah sorry, I added an edit.

      – Ulrike Fischer
      1 hour ago











    • Now there are 6 lines above and 5 below "A". 7 works for me. This solution requires a tedious counting of lines manually.

      – Viesturs
      1 hour ago






    • 1





      Yes, but the A is aligned to a line. It is up to you to decide what is visual more pleasing. And yes, it is a pain - I already wrote in the answer. I wouldn't use multirow but nested tabulars or even simple boxes for such a layout.

      – Ulrike Fischer
      1 hour ago











    • it could be worthwhile to provide your solution with nested tabulars or simple boxes.

      – Viesturs
      59 mins ago











    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%2f486010%2fcentre-cell-vertically-in-tabularx-across-multiple-multiline-rows%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














    As Ulrike said in a comment, to avoid manual adjustment, nesting tabulars could be a solution.



    I would put a tabular with an m column of appropriate width in the main tabular.



    I added the lines just to show the "A" is vertically centered.



    documentclassreport
    usepackagetabularx
    usepackagearray
    usepackagelipsum
    begindocument
    noindentbegintabular
    hline
    A &
    begintabular@lm.352linewidth@
    B & lipsum[1][1-2]\
    C & lipsum[2][1-3]\
    endtabular\
    hline
    endtabular

    vspace4exnoindentbegintabularx.5linewidthllX
    hline
    A & B & Just for benchmark\
    hline
    endtabularx
    enddocument


    enter image description here






    share|improve this answer

























    • In case of multiple multirow cells nesting in a nesting would be required.

      – Viesturs
      36 mins ago











    • @Viesturs Yes, it may be

      – CarLaTeX
      35 mins ago















    3














    As Ulrike said in a comment, to avoid manual adjustment, nesting tabulars could be a solution.



    I would put a tabular with an m column of appropriate width in the main tabular.



    I added the lines just to show the "A" is vertically centered.



    documentclassreport
    usepackagetabularx
    usepackagearray
    usepackagelipsum
    begindocument
    noindentbegintabular
    hline
    A &
    begintabular@lm.352linewidth@
    B & lipsum[1][1-2]\
    C & lipsum[2][1-3]\
    endtabular\
    hline
    endtabular

    vspace4exnoindentbegintabularx.5linewidthllX
    hline
    A & B & Just for benchmark\
    hline
    endtabularx
    enddocument


    enter image description here






    share|improve this answer

























    • In case of multiple multirow cells nesting in a nesting would be required.

      – Viesturs
      36 mins ago











    • @Viesturs Yes, it may be

      – CarLaTeX
      35 mins ago













    3












    3








    3







    As Ulrike said in a comment, to avoid manual adjustment, nesting tabulars could be a solution.



    I would put a tabular with an m column of appropriate width in the main tabular.



    I added the lines just to show the "A" is vertically centered.



    documentclassreport
    usepackagetabularx
    usepackagearray
    usepackagelipsum
    begindocument
    noindentbegintabular
    hline
    A &
    begintabular@lm.352linewidth@
    B & lipsum[1][1-2]\
    C & lipsum[2][1-3]\
    endtabular\
    hline
    endtabular

    vspace4exnoindentbegintabularx.5linewidthllX
    hline
    A & B & Just for benchmark\
    hline
    endtabularx
    enddocument


    enter image description here






    share|improve this answer















    As Ulrike said in a comment, to avoid manual adjustment, nesting tabulars could be a solution.



    I would put a tabular with an m column of appropriate width in the main tabular.



    I added the lines just to show the "A" is vertically centered.



    documentclassreport
    usepackagetabularx
    usepackagearray
    usepackagelipsum
    begindocument
    noindentbegintabular
    hline
    A &
    begintabular@lm.352linewidth@
    B & lipsum[1][1-2]\
    C & lipsum[2][1-3]\
    endtabular\
    hline
    endtabular

    vspace4exnoindentbegintabularx.5linewidthllX
    hline
    A & B & Just for benchmark\
    hline
    endtabularx
    enddocument


    enter image description here







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited 38 mins ago

























    answered 51 mins ago









    CarLaTeXCarLaTeX

    35.3k554152




    35.3k554152












    • In case of multiple multirow cells nesting in a nesting would be required.

      – Viesturs
      36 mins ago











    • @Viesturs Yes, it may be

      – CarLaTeX
      35 mins ago

















    • In case of multiple multirow cells nesting in a nesting would be required.

      – Viesturs
      36 mins ago











    • @Viesturs Yes, it may be

      – CarLaTeX
      35 mins ago
















    In case of multiple multirow cells nesting in a nesting would be required.

    – Viesturs
    36 mins ago





    In case of multiple multirow cells nesting in a nesting would be required.

    – Viesturs
    36 mins ago













    @Viesturs Yes, it may be

    – CarLaTeX
    35 mins ago





    @Viesturs Yes, it may be

    – CarLaTeX
    35 mins ago











    3














    Here is a possibe solution using a minipage and a tabularx:



    documentclassreport
    usepackagetabularx
    usepackagelipsum
    usepackagemultirow
    renewcommandtabularxcolumn[1]m#1
    usepackagecalc

    begindocument

    beginminipage2em
    A
    endminipage%
    begintabularx0.5linewidth-2emlX
    B & lipsum[1][1-2] \
    C & lipsum[2][1-3]\
    endtabularx

    enddocument


    enter image description here






    share|improve this answer



























      3














      Here is a possibe solution using a minipage and a tabularx:



      documentclassreport
      usepackagetabularx
      usepackagelipsum
      usepackagemultirow
      renewcommandtabularxcolumn[1]m#1
      usepackagecalc

      begindocument

      beginminipage2em
      A
      endminipage%
      begintabularx0.5linewidth-2emlX
      B & lipsum[1][1-2] \
      C & lipsum[2][1-3]\
      endtabularx

      enddocument


      enter image description here






      share|improve this answer

























        3












        3








        3







        Here is a possibe solution using a minipage and a tabularx:



        documentclassreport
        usepackagetabularx
        usepackagelipsum
        usepackagemultirow
        renewcommandtabularxcolumn[1]m#1
        usepackagecalc

        begindocument

        beginminipage2em
        A
        endminipage%
        begintabularx0.5linewidth-2emlX
        B & lipsum[1][1-2] \
        C & lipsum[2][1-3]\
        endtabularx

        enddocument


        enter image description here






        share|improve this answer













        Here is a possibe solution using a minipage and a tabularx:



        documentclassreport
        usepackagetabularx
        usepackagelipsum
        usepackagemultirow
        renewcommandtabularxcolumn[1]m#1
        usepackagecalc

        begindocument

        beginminipage2em
        A
        endminipage%
        begintabularx0.5linewidth-2emlX
        B & lipsum[1][1-2] \
        C & lipsum[2][1-3]\
        endtabularx

        enddocument


        enter image description here







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 23 mins ago









        leandriisleandriis

        11.7k1733




        11.7k1733





















            2














            In this case you can use a 1-row multicolumn as the baseline of the m-column is there. In other cases you will have to use the vmode-option described in the documentation. Imho while multirow works okay with 1-line cells it is imho rather a pain with m- and p-columns and I use it seldom.



            documentclassreport
            usepackagetabularx
            usepackagelipsum
            usepackagemultirow
            begindocument
            % with X as p-column 5 works:
            begintabularx0.5linewidthllX
            multirow5*A & B & lipsum[1][1-2] \
            & C & lipsum[2][1-3]\
            endtabularx

            %X as m-column:
            renewcommandtabularxcolumn[1]m#1
            begintabularx0.5linewidthllX
            multirow1*A & B & lipsum[1][1-2] \
            & C & lipsum[2][1-3]\
            endtabularx
            enddocument


            enter image description here



            To center the A over both cells use a value of 8.5 or 9 works (that's the number of lines below the baseline of the first cell.



            documentclassreport
            usepackagetabularx
            usepackagelipsum
            usepackagemultirow
            renewcommandtabularxcolumn[1]m#1
            begindocument
            begintabularx0.5linewidthllX
            multirow9*A & B & lipsum[1][1-2] \
            & C & lipsum[2][1-3]\
            endtabularx
            enddocument


            enter image description here






            share|improve this answer

























            • Where is the improvement? Apparently I was not clear in my question, but by nicely I mean "A" centred vertically in the middle of the table. I updated my question.

              – Viesturs
              1 hour ago












            • Ah sorry, I added an edit.

              – Ulrike Fischer
              1 hour ago











            • Now there are 6 lines above and 5 below "A". 7 works for me. This solution requires a tedious counting of lines manually.

              – Viesturs
              1 hour ago






            • 1





              Yes, but the A is aligned to a line. It is up to you to decide what is visual more pleasing. And yes, it is a pain - I already wrote in the answer. I wouldn't use multirow but nested tabulars or even simple boxes for such a layout.

              – Ulrike Fischer
              1 hour ago











            • it could be worthwhile to provide your solution with nested tabulars or simple boxes.

              – Viesturs
              59 mins ago















            2














            In this case you can use a 1-row multicolumn as the baseline of the m-column is there. In other cases you will have to use the vmode-option described in the documentation. Imho while multirow works okay with 1-line cells it is imho rather a pain with m- and p-columns and I use it seldom.



            documentclassreport
            usepackagetabularx
            usepackagelipsum
            usepackagemultirow
            begindocument
            % with X as p-column 5 works:
            begintabularx0.5linewidthllX
            multirow5*A & B & lipsum[1][1-2] \
            & C & lipsum[2][1-3]\
            endtabularx

            %X as m-column:
            renewcommandtabularxcolumn[1]m#1
            begintabularx0.5linewidthllX
            multirow1*A & B & lipsum[1][1-2] \
            & C & lipsum[2][1-3]\
            endtabularx
            enddocument


            enter image description here



            To center the A over both cells use a value of 8.5 or 9 works (that's the number of lines below the baseline of the first cell.



            documentclassreport
            usepackagetabularx
            usepackagelipsum
            usepackagemultirow
            renewcommandtabularxcolumn[1]m#1
            begindocument
            begintabularx0.5linewidthllX
            multirow9*A & B & lipsum[1][1-2] \
            & C & lipsum[2][1-3]\
            endtabularx
            enddocument


            enter image description here






            share|improve this answer

























            • Where is the improvement? Apparently I was not clear in my question, but by nicely I mean "A" centred vertically in the middle of the table. I updated my question.

              – Viesturs
              1 hour ago












            • Ah sorry, I added an edit.

              – Ulrike Fischer
              1 hour ago











            • Now there are 6 lines above and 5 below "A". 7 works for me. This solution requires a tedious counting of lines manually.

              – Viesturs
              1 hour ago






            • 1





              Yes, but the A is aligned to a line. It is up to you to decide what is visual more pleasing. And yes, it is a pain - I already wrote in the answer. I wouldn't use multirow but nested tabulars or even simple boxes for such a layout.

              – Ulrike Fischer
              1 hour ago











            • it could be worthwhile to provide your solution with nested tabulars or simple boxes.

              – Viesturs
              59 mins ago













            2












            2








            2







            In this case you can use a 1-row multicolumn as the baseline of the m-column is there. In other cases you will have to use the vmode-option described in the documentation. Imho while multirow works okay with 1-line cells it is imho rather a pain with m- and p-columns and I use it seldom.



            documentclassreport
            usepackagetabularx
            usepackagelipsum
            usepackagemultirow
            begindocument
            % with X as p-column 5 works:
            begintabularx0.5linewidthllX
            multirow5*A & B & lipsum[1][1-2] \
            & C & lipsum[2][1-3]\
            endtabularx

            %X as m-column:
            renewcommandtabularxcolumn[1]m#1
            begintabularx0.5linewidthllX
            multirow1*A & B & lipsum[1][1-2] \
            & C & lipsum[2][1-3]\
            endtabularx
            enddocument


            enter image description here



            To center the A over both cells use a value of 8.5 or 9 works (that's the number of lines below the baseline of the first cell.



            documentclassreport
            usepackagetabularx
            usepackagelipsum
            usepackagemultirow
            renewcommandtabularxcolumn[1]m#1
            begindocument
            begintabularx0.5linewidthllX
            multirow9*A & B & lipsum[1][1-2] \
            & C & lipsum[2][1-3]\
            endtabularx
            enddocument


            enter image description here






            share|improve this answer















            In this case you can use a 1-row multicolumn as the baseline of the m-column is there. In other cases you will have to use the vmode-option described in the documentation. Imho while multirow works okay with 1-line cells it is imho rather a pain with m- and p-columns and I use it seldom.



            documentclassreport
            usepackagetabularx
            usepackagelipsum
            usepackagemultirow
            begindocument
            % with X as p-column 5 works:
            begintabularx0.5linewidthllX
            multirow5*A & B & lipsum[1][1-2] \
            & C & lipsum[2][1-3]\
            endtabularx

            %X as m-column:
            renewcommandtabularxcolumn[1]m#1
            begintabularx0.5linewidthllX
            multirow1*A & B & lipsum[1][1-2] \
            & C & lipsum[2][1-3]\
            endtabularx
            enddocument


            enter image description here



            To center the A over both cells use a value of 8.5 or 9 works (that's the number of lines below the baseline of the first cell.



            documentclassreport
            usepackagetabularx
            usepackagelipsum
            usepackagemultirow
            renewcommandtabularxcolumn[1]m#1
            begindocument
            begintabularx0.5linewidthllX
            multirow9*A & B & lipsum[1][1-2] \
            & C & lipsum[2][1-3]\
            endtabularx
            enddocument


            enter image description here







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited 1 hour ago

























            answered 1 hour ago









            Ulrike FischerUlrike Fischer

            200k9306693




            200k9306693












            • Where is the improvement? Apparently I was not clear in my question, but by nicely I mean "A" centred vertically in the middle of the table. I updated my question.

              – Viesturs
              1 hour ago












            • Ah sorry, I added an edit.

              – Ulrike Fischer
              1 hour ago











            • Now there are 6 lines above and 5 below "A". 7 works for me. This solution requires a tedious counting of lines manually.

              – Viesturs
              1 hour ago






            • 1





              Yes, but the A is aligned to a line. It is up to you to decide what is visual more pleasing. And yes, it is a pain - I already wrote in the answer. I wouldn't use multirow but nested tabulars or even simple boxes for such a layout.

              – Ulrike Fischer
              1 hour ago











            • it could be worthwhile to provide your solution with nested tabulars or simple boxes.

              – Viesturs
              59 mins ago

















            • Where is the improvement? Apparently I was not clear in my question, but by nicely I mean "A" centred vertically in the middle of the table. I updated my question.

              – Viesturs
              1 hour ago












            • Ah sorry, I added an edit.

              – Ulrike Fischer
              1 hour ago











            • Now there are 6 lines above and 5 below "A". 7 works for me. This solution requires a tedious counting of lines manually.

              – Viesturs
              1 hour ago






            • 1





              Yes, but the A is aligned to a line. It is up to you to decide what is visual more pleasing. And yes, it is a pain - I already wrote in the answer. I wouldn't use multirow but nested tabulars or even simple boxes for such a layout.

              – Ulrike Fischer
              1 hour ago











            • it could be worthwhile to provide your solution with nested tabulars or simple boxes.

              – Viesturs
              59 mins ago
















            Where is the improvement? Apparently I was not clear in my question, but by nicely I mean "A" centred vertically in the middle of the table. I updated my question.

            – Viesturs
            1 hour ago






            Where is the improvement? Apparently I was not clear in my question, but by nicely I mean "A" centred vertically in the middle of the table. I updated my question.

            – Viesturs
            1 hour ago














            Ah sorry, I added an edit.

            – Ulrike Fischer
            1 hour ago





            Ah sorry, I added an edit.

            – Ulrike Fischer
            1 hour ago













            Now there are 6 lines above and 5 below "A". 7 works for me. This solution requires a tedious counting of lines manually.

            – Viesturs
            1 hour ago





            Now there are 6 lines above and 5 below "A". 7 works for me. This solution requires a tedious counting of lines manually.

            – Viesturs
            1 hour ago




            1




            1





            Yes, but the A is aligned to a line. It is up to you to decide what is visual more pleasing. And yes, it is a pain - I already wrote in the answer. I wouldn't use multirow but nested tabulars or even simple boxes for such a layout.

            – Ulrike Fischer
            1 hour ago





            Yes, but the A is aligned to a line. It is up to you to decide what is visual more pleasing. And yes, it is a pain - I already wrote in the answer. I wouldn't use multirow but nested tabulars or even simple boxes for such a layout.

            – Ulrike Fischer
            1 hour ago













            it could be worthwhile to provide your solution with nested tabulars or simple boxes.

            – Viesturs
            59 mins ago





            it could be worthwhile to provide your solution with nested tabulars or simple boxes.

            – Viesturs
            59 mins ago

















            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%2f486010%2fcentre-cell-vertically-in-tabularx-across-multiple-multiline-rows%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

            Are there any comparative studies done between Ashtavakra Gita and Buddhim?How is it wrong to believe that a self exists, or that it doesn't?Can you criticise or improve Ven. Bodhi's description of MahayanaWas the doctrine of 'Anatta', accepted as doctrine by modern Buddhism, actually taught by the Buddha?Relationship between Buddhism, Hinduism and Yoga?Comparison of Nirvana, Tao and Brahman/AtmaIs there a distinction between “ego identity” and “craving/hating”?Are there many differences between Taoism and Buddhism?Loss of “faith” in buddhismSimilarity between creation in Abrahamic religions and beginning of life in Earth mentioned Agganna Sutta?Are there studies about the difference between meditating in the morning versus in the evening?Can one follow Hinduism and Buddhism at the same time?Are there any prohibitions on participating in other religion's practices?Psychology of 'flow'

            fallocate: fallocate failed: Text file busy in Ubuntu 17.04? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)defragmenting and increasing performance of old lubuntu system with swap partitionIssue with increasing the root partition from the swapthis /usr/bin/dpkg returned error || ubuntu-16.04, 64bitDefault 17.04 swap file locationHow to Resize Ubuntu 17.04 Zesty Swap file size?Ubuntu freezes from online formsMy Laptop is not starting after upgrade ubuntu 16.04 (Kernel 4.8.0-38 to 04.10.0-36)hcp: ERROR: FALLOCATE FAILED!Not sure my swap is being usedWine 3.0 asking for more virtual free swap

            Where else does the Shulchan Aruch quote an authority by name?Parashat Metzora+HagadolPesach/PassoverShulchan Aruch UTF-8Anonymous glosses in the Shulchan AruchWhy is the Shulchan Aruch definitive?Siman 32, Kitzur Shulchan Aruch: UntranslatedLitvaks/Yeshivish and Shulchan AruchBuying a Shulchan AruchEnglish version of SHULCHAN ARUCHIs there any place where Shulchan Aruch rules with the Rosh against the Rif and Rambam?Are there practices where Sepharadim do not hold by Shulchan Aruch?5th part of the shulchan aruch