Table caption in the middle of the tableWhy does an environment's label have to appear after the caption?How to get multiple multirows in a table?Paragraph column in tabular working only in the first columnCentering a table while ignoring the 1st column in centering procedureRotated Text in Table Extending into Rows in Lyxtabu package - gaps in vertical linesTable - APA6 class - rotating (with caption and table notes)Horizontal lines in nested tabular environmentAdding 3 multi-columns upside in a tableHow to set longtable width to text width so that the text in cell wraps around automatically?Wrapping text within a multirow cell

Configurable API Version for Anonymous Blocks?

In an emergency, how do I find and share my position?

What is the hex versus octal timeline?

Bankers with rancor

Brexit and backstop: would changes require unanimous approval by all EU countries? Does Ireland hold a veto?

Why is observed clock rate < 3MHz on Arduino Uno?

Why does my house heat up, even when it's cool outside?

Why aren't RCS openings an issue for spacecraft heat shields?

Script that helps people make better choices

Why we don't have vaccination against all diseases which are caused by microbes?

Concatenation of the result of a function with a mutable default argument in python

If all stars rotate, why was there a theory developed, that requires non-rotating stars?

Quickly evaluating this limit

Is a butterfly one or two animals?

What is wrong about this application of Kirchhoffs Current Law?

Table caption in the middle of the table

Is it safe to remove the bottom chords of a series of garage roof trusses?

Defense against attacks using dictionaries

Why is Boris Johnson visiting only Paris & Berlin if every member of the EU needs to agree on a withdrawal deal?

Shouldn't the "credit score" prevent Americans from going deeper and deeper into personal debt?

Why can't an Airbus A330 dump fuel in an emergency?

Are illustrations in novels frowned upon?

Is it possible to create a golf ball sized star?

How to refer to a regex group in awk regex?



Table caption in the middle of the table


Why does an environment's label have to appear after the caption?How to get multiple multirows in a table?Paragraph column in tabular working only in the first columnCentering a table while ignoring the 1st column in centering procedureRotated Text in Table Extending into Rows in Lyxtabu package - gaps in vertical linesTable - APA6 class - rotating (with caption and table notes)Horizontal lines in nested tabular environmentAdding 3 multi-columns upside in a tableHow to set longtable width to text width so that the text in cell wraps around automatically?Wrapping text within a multirow cell






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








3















I managed to make a table but the caption (or any text I add after it) is in the middle of the table, as if the table ended after the second row. I couldn't find a similar question so I decided to ask myself.



I added the caption and some text after the table. They both behave as if the table ended after the second row



Without the caption, or any text before/after it, the table looks almost how I would want it to look.



This is how the table looks without the caption



documentclassreport
usepackagemultirow


begindocument

This is some text and here is a reference to Table reftable:mytable.


begintable [h]
centering
begintabular c c c \
textbfColumn A & textbfColumn B & textbfColumn C \

hline

multirow3*textbfTest1
& multirow3*shortstack[l]line1 \ line2 \ line3
& multirow3*shortstack[l]line1 \ line2 \ line3 \

multirow6*textbfTest2
& multicolumn2c multirow6*shortstack[l]line1 \ line2 \ line3 \

multirow9*textbfTest3
& multirow9*shortstack[l]line1 \ line2 \ line3
& multirow9*shortstack[l]line1 \ line2 \ line3 \

multirow12*textbfTest4
& multirow12*shortstack[l]line1 \ line2 \ line3
& multirow12*shortstack[l]line1 \ line2 \ line3 \

endtabular
labeltable:mytable
captionThis is the caption.

endtable

enddocument


As a side note, the referencing also isn't working properly for some reason?. I wanted the sentence to say




[...] here is a reference to Table 1.




and instead it just says




[...] here is a reference to Table .




I've managed to use ref with other tables but not this one.










share|improve this question









New contributor



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





















  • Do you know how multirow works? For example, what does the first argument in multirow12 mean. Once you figure that out, I'm sure you'll understand what's going on.

    – Werner
    8 hours ago











  • From what I understand, it's the number of rows I want the multirow block to be. In this case, it's 3 rows. So the first multirow is rows 1-3, the second one is 3-6 and so on.

    – NATS
    8 hours ago











  • Will there always bw three lines in colum B and C?

    – leandriis
    8 hours ago











  • @NATS You have programmed last multirow to span 12 column, not 3. If you add all the spanning, you get 3+6+9+12=30 rows, and you have 12 rows in your table. I suggest you reread the multirow manual.

    – Sveinung
    7 hours ago


















3















I managed to make a table but the caption (or any text I add after it) is in the middle of the table, as if the table ended after the second row. I couldn't find a similar question so I decided to ask myself.



I added the caption and some text after the table. They both behave as if the table ended after the second row



Without the caption, or any text before/after it, the table looks almost how I would want it to look.



This is how the table looks without the caption



documentclassreport
usepackagemultirow


begindocument

This is some text and here is a reference to Table reftable:mytable.


begintable [h]
centering
begintabular c c c \
textbfColumn A & textbfColumn B & textbfColumn C \

hline

multirow3*textbfTest1
& multirow3*shortstack[l]line1 \ line2 \ line3
& multirow3*shortstack[l]line1 \ line2 \ line3 \

multirow6*textbfTest2
& multicolumn2c multirow6*shortstack[l]line1 \ line2 \ line3 \

multirow9*textbfTest3
& multirow9*shortstack[l]line1 \ line2 \ line3
& multirow9*shortstack[l]line1 \ line2 \ line3 \

multirow12*textbfTest4
& multirow12*shortstack[l]line1 \ line2 \ line3
& multirow12*shortstack[l]line1 \ line2 \ line3 \

endtabular
labeltable:mytable
captionThis is the caption.

endtable

enddocument


As a side note, the referencing also isn't working properly for some reason?. I wanted the sentence to say




[...] here is a reference to Table 1.




and instead it just says




[...] here is a reference to Table .




I've managed to use ref with other tables but not this one.










share|improve this question









New contributor



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





















  • Do you know how multirow works? For example, what does the first argument in multirow12 mean. Once you figure that out, I'm sure you'll understand what's going on.

    – Werner
    8 hours ago











  • From what I understand, it's the number of rows I want the multirow block to be. In this case, it's 3 rows. So the first multirow is rows 1-3, the second one is 3-6 and so on.

    – NATS
    8 hours ago











  • Will there always bw three lines in colum B and C?

    – leandriis
    8 hours ago











  • @NATS You have programmed last multirow to span 12 column, not 3. If you add all the spanning, you get 3+6+9+12=30 rows, and you have 12 rows in your table. I suggest you reread the multirow manual.

    – Sveinung
    7 hours ago














3












3








3


1






I managed to make a table but the caption (or any text I add after it) is in the middle of the table, as if the table ended after the second row. I couldn't find a similar question so I decided to ask myself.



I added the caption and some text after the table. They both behave as if the table ended after the second row



Without the caption, or any text before/after it, the table looks almost how I would want it to look.



This is how the table looks without the caption



documentclassreport
usepackagemultirow


begindocument

This is some text and here is a reference to Table reftable:mytable.


begintable [h]
centering
begintabular c c c \
textbfColumn A & textbfColumn B & textbfColumn C \

hline

multirow3*textbfTest1
& multirow3*shortstack[l]line1 \ line2 \ line3
& multirow3*shortstack[l]line1 \ line2 \ line3 \

multirow6*textbfTest2
& multicolumn2c multirow6*shortstack[l]line1 \ line2 \ line3 \

multirow9*textbfTest3
& multirow9*shortstack[l]line1 \ line2 \ line3
& multirow9*shortstack[l]line1 \ line2 \ line3 \

multirow12*textbfTest4
& multirow12*shortstack[l]line1 \ line2 \ line3
& multirow12*shortstack[l]line1 \ line2 \ line3 \

endtabular
labeltable:mytable
captionThis is the caption.

endtable

enddocument


As a side note, the referencing also isn't working properly for some reason?. I wanted the sentence to say




[...] here is a reference to Table 1.




and instead it just says




[...] here is a reference to Table .




I've managed to use ref with other tables but not this one.










share|improve this question









New contributor



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











I managed to make a table but the caption (or any text I add after it) is in the middle of the table, as if the table ended after the second row. I couldn't find a similar question so I decided to ask myself.



I added the caption and some text after the table. They both behave as if the table ended after the second row



Without the caption, or any text before/after it, the table looks almost how I would want it to look.



This is how the table looks without the caption



documentclassreport
usepackagemultirow


begindocument

This is some text and here is a reference to Table reftable:mytable.


begintable [h]
centering
begintabular c c c \
textbfColumn A & textbfColumn B & textbfColumn C \

hline

multirow3*textbfTest1
& multirow3*shortstack[l]line1 \ line2 \ line3
& multirow3*shortstack[l]line1 \ line2 \ line3 \

multirow6*textbfTest2
& multicolumn2c multirow6*shortstack[l]line1 \ line2 \ line3 \

multirow9*textbfTest3
& multirow9*shortstack[l]line1 \ line2 \ line3
& multirow9*shortstack[l]line1 \ line2 \ line3 \

multirow12*textbfTest4
& multirow12*shortstack[l]line1 \ line2 \ line3
& multirow12*shortstack[l]line1 \ line2 \ line3 \

endtabular
labeltable:mytable
captionThis is the caption.

endtable

enddocument


As a side note, the referencing also isn't working properly for some reason?. I wanted the sentence to say




[...] here is a reference to Table 1.




and instead it just says




[...] here is a reference to Table .




I've managed to use ref with other tables but not this one.







tables cross-referencing captions multirow






share|improve this question









New contributor



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










share|improve this question









New contributor



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








share|improve this question




share|improve this question








edited 8 hours ago









Werner

460k77 gold badges1029 silver badges1772 bronze badges




460k77 gold badges1029 silver badges1772 bronze badges






New contributor



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








asked 8 hours ago









NATSNATS

183 bronze badges




183 bronze badges




New contributor



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




New contributor




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

















  • Do you know how multirow works? For example, what does the first argument in multirow12 mean. Once you figure that out, I'm sure you'll understand what's going on.

    – Werner
    8 hours ago











  • From what I understand, it's the number of rows I want the multirow block to be. In this case, it's 3 rows. So the first multirow is rows 1-3, the second one is 3-6 and so on.

    – NATS
    8 hours ago











  • Will there always bw three lines in colum B and C?

    – leandriis
    8 hours ago











  • @NATS You have programmed last multirow to span 12 column, not 3. If you add all the spanning, you get 3+6+9+12=30 rows, and you have 12 rows in your table. I suggest you reread the multirow manual.

    – Sveinung
    7 hours ago


















  • Do you know how multirow works? For example, what does the first argument in multirow12 mean. Once you figure that out, I'm sure you'll understand what's going on.

    – Werner
    8 hours ago











  • From what I understand, it's the number of rows I want the multirow block to be. In this case, it's 3 rows. So the first multirow is rows 1-3, the second one is 3-6 and so on.

    – NATS
    8 hours ago











  • Will there always bw three lines in colum B and C?

    – leandriis
    8 hours ago











  • @NATS You have programmed last multirow to span 12 column, not 3. If you add all the spanning, you get 3+6+9+12=30 rows, and you have 12 rows in your table. I suggest you reread the multirow manual.

    – Sveinung
    7 hours ago

















Do you know how multirow works? For example, what does the first argument in multirow12 mean. Once you figure that out, I'm sure you'll understand what's going on.

– Werner
8 hours ago





Do you know how multirow works? For example, what does the first argument in multirow12 mean. Once you figure that out, I'm sure you'll understand what's going on.

– Werner
8 hours ago













From what I understand, it's the number of rows I want the multirow block to be. In this case, it's 3 rows. So the first multirow is rows 1-3, the second one is 3-6 and so on.

– NATS
8 hours ago





From what I understand, it's the number of rows I want the multirow block to be. In this case, it's 3 rows. So the first multirow is rows 1-3, the second one is 3-6 and so on.

– NATS
8 hours ago













Will there always bw three lines in colum B and C?

– leandriis
8 hours ago





Will there always bw three lines in colum B and C?

– leandriis
8 hours ago













@NATS You have programmed last multirow to span 12 column, not 3. If you add all the spanning, you get 3+6+9+12=30 rows, and you have 12 rows in your table. I suggest you reread the multirow manual.

– Sveinung
7 hours ago






@NATS You have programmed last multirow to span 12 column, not 3. If you add all the spanning, you get 3+6+9+12=30 rows, and you have 12 rows in your table. I suggest you reread the multirow manual.

– Sveinung
7 hours ago











3 Answers
3






active

oldest

votes


















2













multirow<nrows><width><text> spreads text (vertically) across <nrows> rows of width <width>. If <width> is given as *, it uses the natural width of <text>. So, for example, using multirow12*<...> means you want to spread that specific cell over 12 rows. It's obviously incorrect since each TestX you want to spread over only 3 rows.



Here's a slightly different implementation (since you don't need multirow here) using makecell:



enter image description here



documentclassreport

usepackagemakecell

begindocument

This is some text and here is a reference to Table~reftable:mytable.

begintable [h]
centering
begintabular c c c
textbfColumn A & textbfColumn B & textbfColumn C \
hline
textbfTest1
& makecellline1 \ line2 \ line3
& makecellline1 \ line2 \ line3 \
textbfTest2
& multicolumn2cmakecellline1 \ line2 \ line3 \
textbfTest3
& makecellline1 \ line2 \ line3
& makecellline1 \ line2 \ line3 \
textbfTest4
& makecellline1 \ line2 \ line3
& makecellline1 \ line2 \ line3
endtabular
captionThis is the caption.
labeltable:mytable
endtable

enddocument


Note how the label comes after caption in order to achieve the correct reference. See Why does an environment's label have to appear after the caption?.






share|improve this answer

























  • If you always have 3 rows/elements in Column B & Column C, you don't need makecell either. Just place the Column A entry on the second row of each "block."

    – Werner
    8 hours ago


















2













As I write in the comment to the question, you have misunderstood how multirow calculate spanning of rows, but it is easily fixed. Just add 3 all places (i.e instead of 6, 9 and 12).



To fix the misplaced caption, and if you want to use your original code, you have to add extra space after the multirow row to create enough space for the spanned rows. Since you span three rows, you may either add two rows (&&\) or extra height at the end-of-row command (\[<height>]. I added two normalbaselineskips so you have space equal three rows.



The safest place for the label is inside the caption command. Then it will not fail.



enter image description here



documentclassreport
usepackagemultirow


begindocument

This is some text and here is a reference to Table reftable:mytable. As you see, the table is a float, and since you have available space, it is place at top of the page. Do not mess around with placing floats before you have finished all creative writing. Everting you do, will be invalid when you add more text.


begintable
centering
begintabular c c c \
textbfColumn A & textbfColumn B & textbfColumn C \
hline
multirow3*textbfTest1
& multirow3*shortstack[l]line1 \ line2 \ line3
& multirow3*shortstack[l]line1 \ line2 \ line3 \[2normalbaselineskip] % Add more space
multirow3*textbfTest2
& multicolumn2c multirow3*shortstack[l]line1 \ line2 \ line3 \[2normalbaselineskip] multirow3*textbfTest3
& multirow3*shortstack[l]line1 \ line2 \ line3
& multirow3*shortstack[l]line1 \ line2 \ line3 \[2normalbaselineskip]
multirow3*textbfTest4
& multirow3*shortstack[l]line1 \ line2 \ line3
& multirow3*shortstack[l]line1 \ line2 \ line3 \[2normalbaselineskip]
endtabular
captionThis is the caption.labeltable:mytable
endtable

enddocument





share|improve this answer


































    1













    A variant code, also based on makecell, combined with multirow – and booktabs, to add some padding around rules. I added some vertical spacing to separate the groups of three lines. Also, a reference to requires a label command (after the caption) to work.



    documentclassreport
    usepackagemultirow
    usepackagemakecell, booktabs
    renewcommandtheadfontnormalsizebfseries


    begindocument

    This is some text and here is a reference to Table reftable:mytable.

    begintable [h]
    centering
    begintabular c c c \
    textbfColumn A & textbfColumn B & textbfColumn C \
    midrule
    multirowthead3Test1 & line1 & line1 \
    & line2 & line2 \
    & line3 & line 3\
    addlinespace
    textbfTest2 & multicolumn2cmakecellline1 \ line2 \ line3 \
    addlinespace
    multirowthead3Test 3 & line1 & line1 \
    & line2 & line2 \
    & line3 & line 3\
    addlinespace
    multirowthead3Test 4 & line1 & line1 \
    & line2 & line2 \
    & line3 & line 3\
    bottomrule
    endtabular
    labeltable:mytable
    captionThis is the caption.labeltable:mytable

    endtable

    enddocument


    enter image description here






    share|improve this answer



























      Your Answer








      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "85"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      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
      );



      );






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









      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f505159%2ftable-caption-in-the-middle-of-the-table%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









      2













      multirow<nrows><width><text> spreads text (vertically) across <nrows> rows of width <width>. If <width> is given as *, it uses the natural width of <text>. So, for example, using multirow12*<...> means you want to spread that specific cell over 12 rows. It's obviously incorrect since each TestX you want to spread over only 3 rows.



      Here's a slightly different implementation (since you don't need multirow here) using makecell:



      enter image description here



      documentclassreport

      usepackagemakecell

      begindocument

      This is some text and here is a reference to Table~reftable:mytable.

      begintable [h]
      centering
      begintabular c c c
      textbfColumn A & textbfColumn B & textbfColumn C \
      hline
      textbfTest1
      & makecellline1 \ line2 \ line3
      & makecellline1 \ line2 \ line3 \
      textbfTest2
      & multicolumn2cmakecellline1 \ line2 \ line3 \
      textbfTest3
      & makecellline1 \ line2 \ line3
      & makecellline1 \ line2 \ line3 \
      textbfTest4
      & makecellline1 \ line2 \ line3
      & makecellline1 \ line2 \ line3
      endtabular
      captionThis is the caption.
      labeltable:mytable
      endtable

      enddocument


      Note how the label comes after caption in order to achieve the correct reference. See Why does an environment's label have to appear after the caption?.






      share|improve this answer

























      • If you always have 3 rows/elements in Column B & Column C, you don't need makecell either. Just place the Column A entry on the second row of each "block."

        – Werner
        8 hours ago















      2













      multirow<nrows><width><text> spreads text (vertically) across <nrows> rows of width <width>. If <width> is given as *, it uses the natural width of <text>. So, for example, using multirow12*<...> means you want to spread that specific cell over 12 rows. It's obviously incorrect since each TestX you want to spread over only 3 rows.



      Here's a slightly different implementation (since you don't need multirow here) using makecell:



      enter image description here



      documentclassreport

      usepackagemakecell

      begindocument

      This is some text and here is a reference to Table~reftable:mytable.

      begintable [h]
      centering
      begintabular c c c
      textbfColumn A & textbfColumn B & textbfColumn C \
      hline
      textbfTest1
      & makecellline1 \ line2 \ line3
      & makecellline1 \ line2 \ line3 \
      textbfTest2
      & multicolumn2cmakecellline1 \ line2 \ line3 \
      textbfTest3
      & makecellline1 \ line2 \ line3
      & makecellline1 \ line2 \ line3 \
      textbfTest4
      & makecellline1 \ line2 \ line3
      & makecellline1 \ line2 \ line3
      endtabular
      captionThis is the caption.
      labeltable:mytable
      endtable

      enddocument


      Note how the label comes after caption in order to achieve the correct reference. See Why does an environment's label have to appear after the caption?.






      share|improve this answer

























      • If you always have 3 rows/elements in Column B & Column C, you don't need makecell either. Just place the Column A entry on the second row of each "block."

        – Werner
        8 hours ago













      2












      2








      2







      multirow<nrows><width><text> spreads text (vertically) across <nrows> rows of width <width>. If <width> is given as *, it uses the natural width of <text>. So, for example, using multirow12*<...> means you want to spread that specific cell over 12 rows. It's obviously incorrect since each TestX you want to spread over only 3 rows.



      Here's a slightly different implementation (since you don't need multirow here) using makecell:



      enter image description here



      documentclassreport

      usepackagemakecell

      begindocument

      This is some text and here is a reference to Table~reftable:mytable.

      begintable [h]
      centering
      begintabular c c c
      textbfColumn A & textbfColumn B & textbfColumn C \
      hline
      textbfTest1
      & makecellline1 \ line2 \ line3
      & makecellline1 \ line2 \ line3 \
      textbfTest2
      & multicolumn2cmakecellline1 \ line2 \ line3 \
      textbfTest3
      & makecellline1 \ line2 \ line3
      & makecellline1 \ line2 \ line3 \
      textbfTest4
      & makecellline1 \ line2 \ line3
      & makecellline1 \ line2 \ line3
      endtabular
      captionThis is the caption.
      labeltable:mytable
      endtable

      enddocument


      Note how the label comes after caption in order to achieve the correct reference. See Why does an environment's label have to appear after the caption?.






      share|improve this answer













      multirow<nrows><width><text> spreads text (vertically) across <nrows> rows of width <width>. If <width> is given as *, it uses the natural width of <text>. So, for example, using multirow12*<...> means you want to spread that specific cell over 12 rows. It's obviously incorrect since each TestX you want to spread over only 3 rows.



      Here's a slightly different implementation (since you don't need multirow here) using makecell:



      enter image description here



      documentclassreport

      usepackagemakecell

      begindocument

      This is some text and here is a reference to Table~reftable:mytable.

      begintable [h]
      centering
      begintabular c c c
      textbfColumn A & textbfColumn B & textbfColumn C \
      hline
      textbfTest1
      & makecellline1 \ line2 \ line3
      & makecellline1 \ line2 \ line3 \
      textbfTest2
      & multicolumn2cmakecellline1 \ line2 \ line3 \
      textbfTest3
      & makecellline1 \ line2 \ line3
      & makecellline1 \ line2 \ line3 \
      textbfTest4
      & makecellline1 \ line2 \ line3
      & makecellline1 \ line2 \ line3
      endtabular
      captionThis is the caption.
      labeltable:mytable
      endtable

      enddocument


      Note how the label comes after caption in order to achieve the correct reference. See Why does an environment's label have to appear after the caption?.







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered 8 hours ago









      WernerWerner

      460k77 gold badges1029 silver badges1772 bronze badges




      460k77 gold badges1029 silver badges1772 bronze badges















      • If you always have 3 rows/elements in Column B & Column C, you don't need makecell either. Just place the Column A entry on the second row of each "block."

        – Werner
        8 hours ago

















      • If you always have 3 rows/elements in Column B & Column C, you don't need makecell either. Just place the Column A entry on the second row of each "block."

        – Werner
        8 hours ago
















      If you always have 3 rows/elements in Column B & Column C, you don't need makecell either. Just place the Column A entry on the second row of each "block."

      – Werner
      8 hours ago





      If you always have 3 rows/elements in Column B & Column C, you don't need makecell either. Just place the Column A entry on the second row of each "block."

      – Werner
      8 hours ago













      2













      As I write in the comment to the question, you have misunderstood how multirow calculate spanning of rows, but it is easily fixed. Just add 3 all places (i.e instead of 6, 9 and 12).



      To fix the misplaced caption, and if you want to use your original code, you have to add extra space after the multirow row to create enough space for the spanned rows. Since you span three rows, you may either add two rows (&&\) or extra height at the end-of-row command (\[<height>]. I added two normalbaselineskips so you have space equal three rows.



      The safest place for the label is inside the caption command. Then it will not fail.



      enter image description here



      documentclassreport
      usepackagemultirow


      begindocument

      This is some text and here is a reference to Table reftable:mytable. As you see, the table is a float, and since you have available space, it is place at top of the page. Do not mess around with placing floats before you have finished all creative writing. Everting you do, will be invalid when you add more text.


      begintable
      centering
      begintabular c c c \
      textbfColumn A & textbfColumn B & textbfColumn C \
      hline
      multirow3*textbfTest1
      & multirow3*shortstack[l]line1 \ line2 \ line3
      & multirow3*shortstack[l]line1 \ line2 \ line3 \[2normalbaselineskip] % Add more space
      multirow3*textbfTest2
      & multicolumn2c multirow3*shortstack[l]line1 \ line2 \ line3 \[2normalbaselineskip] multirow3*textbfTest3
      & multirow3*shortstack[l]line1 \ line2 \ line3
      & multirow3*shortstack[l]line1 \ line2 \ line3 \[2normalbaselineskip]
      multirow3*textbfTest4
      & multirow3*shortstack[l]line1 \ line2 \ line3
      & multirow3*shortstack[l]line1 \ line2 \ line3 \[2normalbaselineskip]
      endtabular
      captionThis is the caption.labeltable:mytable
      endtable

      enddocument





      share|improve this answer































        2













        As I write in the comment to the question, you have misunderstood how multirow calculate spanning of rows, but it is easily fixed. Just add 3 all places (i.e instead of 6, 9 and 12).



        To fix the misplaced caption, and if you want to use your original code, you have to add extra space after the multirow row to create enough space for the spanned rows. Since you span three rows, you may either add two rows (&&\) or extra height at the end-of-row command (\[<height>]. I added two normalbaselineskips so you have space equal three rows.



        The safest place for the label is inside the caption command. Then it will not fail.



        enter image description here



        documentclassreport
        usepackagemultirow


        begindocument

        This is some text and here is a reference to Table reftable:mytable. As you see, the table is a float, and since you have available space, it is place at top of the page. Do not mess around with placing floats before you have finished all creative writing. Everting you do, will be invalid when you add more text.


        begintable
        centering
        begintabular c c c \
        textbfColumn A & textbfColumn B & textbfColumn C \
        hline
        multirow3*textbfTest1
        & multirow3*shortstack[l]line1 \ line2 \ line3
        & multirow3*shortstack[l]line1 \ line2 \ line3 \[2normalbaselineskip] % Add more space
        multirow3*textbfTest2
        & multicolumn2c multirow3*shortstack[l]line1 \ line2 \ line3 \[2normalbaselineskip] multirow3*textbfTest3
        & multirow3*shortstack[l]line1 \ line2 \ line3
        & multirow3*shortstack[l]line1 \ line2 \ line3 \[2normalbaselineskip]
        multirow3*textbfTest4
        & multirow3*shortstack[l]line1 \ line2 \ line3
        & multirow3*shortstack[l]line1 \ line2 \ line3 \[2normalbaselineskip]
        endtabular
        captionThis is the caption.labeltable:mytable
        endtable

        enddocument





        share|improve this answer





























          2












          2








          2







          As I write in the comment to the question, you have misunderstood how multirow calculate spanning of rows, but it is easily fixed. Just add 3 all places (i.e instead of 6, 9 and 12).



          To fix the misplaced caption, and if you want to use your original code, you have to add extra space after the multirow row to create enough space for the spanned rows. Since you span three rows, you may either add two rows (&&\) or extra height at the end-of-row command (\[<height>]. I added two normalbaselineskips so you have space equal three rows.



          The safest place for the label is inside the caption command. Then it will not fail.



          enter image description here



          documentclassreport
          usepackagemultirow


          begindocument

          This is some text and here is a reference to Table reftable:mytable. As you see, the table is a float, and since you have available space, it is place at top of the page. Do not mess around with placing floats before you have finished all creative writing. Everting you do, will be invalid when you add more text.


          begintable
          centering
          begintabular c c c \
          textbfColumn A & textbfColumn B & textbfColumn C \
          hline
          multirow3*textbfTest1
          & multirow3*shortstack[l]line1 \ line2 \ line3
          & multirow3*shortstack[l]line1 \ line2 \ line3 \[2normalbaselineskip] % Add more space
          multirow3*textbfTest2
          & multicolumn2c multirow3*shortstack[l]line1 \ line2 \ line3 \[2normalbaselineskip] multirow3*textbfTest3
          & multirow3*shortstack[l]line1 \ line2 \ line3
          & multirow3*shortstack[l]line1 \ line2 \ line3 \[2normalbaselineskip]
          multirow3*textbfTest4
          & multirow3*shortstack[l]line1 \ line2 \ line3
          & multirow3*shortstack[l]line1 \ line2 \ line3 \[2normalbaselineskip]
          endtabular
          captionThis is the caption.labeltable:mytable
          endtable

          enddocument





          share|improve this answer















          As I write in the comment to the question, you have misunderstood how multirow calculate spanning of rows, but it is easily fixed. Just add 3 all places (i.e instead of 6, 9 and 12).



          To fix the misplaced caption, and if you want to use your original code, you have to add extra space after the multirow row to create enough space for the spanned rows. Since you span three rows, you may either add two rows (&&\) or extra height at the end-of-row command (\[<height>]. I added two normalbaselineskips so you have space equal three rows.



          The safest place for the label is inside the caption command. Then it will not fail.



          enter image description here



          documentclassreport
          usepackagemultirow


          begindocument

          This is some text and here is a reference to Table reftable:mytable. As you see, the table is a float, and since you have available space, it is place at top of the page. Do not mess around with placing floats before you have finished all creative writing. Everting you do, will be invalid when you add more text.


          begintable
          centering
          begintabular c c c \
          textbfColumn A & textbfColumn B & textbfColumn C \
          hline
          multirow3*textbfTest1
          & multirow3*shortstack[l]line1 \ line2 \ line3
          & multirow3*shortstack[l]line1 \ line2 \ line3 \[2normalbaselineskip] % Add more space
          multirow3*textbfTest2
          & multicolumn2c multirow3*shortstack[l]line1 \ line2 \ line3 \[2normalbaselineskip] multirow3*textbfTest3
          & multirow3*shortstack[l]line1 \ line2 \ line3
          & multirow3*shortstack[l]line1 \ line2 \ line3 \[2normalbaselineskip]
          multirow3*textbfTest4
          & multirow3*shortstack[l]line1 \ line2 \ line3
          & multirow3*shortstack[l]line1 \ line2 \ line3 \[2normalbaselineskip]
          endtabular
          captionThis is the caption.labeltable:mytable
          endtable

          enddocument






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 7 hours ago

























          answered 7 hours ago









          SveinungSveinung

          13.6k2 gold badges36 silver badges63 bronze badges




          13.6k2 gold badges36 silver badges63 bronze badges
























              1













              A variant code, also based on makecell, combined with multirow – and booktabs, to add some padding around rules. I added some vertical spacing to separate the groups of three lines. Also, a reference to requires a label command (after the caption) to work.



              documentclassreport
              usepackagemultirow
              usepackagemakecell, booktabs
              renewcommandtheadfontnormalsizebfseries


              begindocument

              This is some text and here is a reference to Table reftable:mytable.

              begintable [h]
              centering
              begintabular c c c \
              textbfColumn A & textbfColumn B & textbfColumn C \
              midrule
              multirowthead3Test1 & line1 & line1 \
              & line2 & line2 \
              & line3 & line 3\
              addlinespace
              textbfTest2 & multicolumn2cmakecellline1 \ line2 \ line3 \
              addlinespace
              multirowthead3Test 3 & line1 & line1 \
              & line2 & line2 \
              & line3 & line 3\
              addlinespace
              multirowthead3Test 4 & line1 & line1 \
              & line2 & line2 \
              & line3 & line 3\
              bottomrule
              endtabular
              labeltable:mytable
              captionThis is the caption.labeltable:mytable

              endtable

              enddocument


              enter image description here






              share|improve this answer





























                1













                A variant code, also based on makecell, combined with multirow – and booktabs, to add some padding around rules. I added some vertical spacing to separate the groups of three lines. Also, a reference to requires a label command (after the caption) to work.



                documentclassreport
                usepackagemultirow
                usepackagemakecell, booktabs
                renewcommandtheadfontnormalsizebfseries


                begindocument

                This is some text and here is a reference to Table reftable:mytable.

                begintable [h]
                centering
                begintabular c c c \
                textbfColumn A & textbfColumn B & textbfColumn C \
                midrule
                multirowthead3Test1 & line1 & line1 \
                & line2 & line2 \
                & line3 & line 3\
                addlinespace
                textbfTest2 & multicolumn2cmakecellline1 \ line2 \ line3 \
                addlinespace
                multirowthead3Test 3 & line1 & line1 \
                & line2 & line2 \
                & line3 & line 3\
                addlinespace
                multirowthead3Test 4 & line1 & line1 \
                & line2 & line2 \
                & line3 & line 3\
                bottomrule
                endtabular
                labeltable:mytable
                captionThis is the caption.labeltable:mytable

                endtable

                enddocument


                enter image description here






                share|improve this answer



























                  1












                  1








                  1







                  A variant code, also based on makecell, combined with multirow – and booktabs, to add some padding around rules. I added some vertical spacing to separate the groups of three lines. Also, a reference to requires a label command (after the caption) to work.



                  documentclassreport
                  usepackagemultirow
                  usepackagemakecell, booktabs
                  renewcommandtheadfontnormalsizebfseries


                  begindocument

                  This is some text and here is a reference to Table reftable:mytable.

                  begintable [h]
                  centering
                  begintabular c c c \
                  textbfColumn A & textbfColumn B & textbfColumn C \
                  midrule
                  multirowthead3Test1 & line1 & line1 \
                  & line2 & line2 \
                  & line3 & line 3\
                  addlinespace
                  textbfTest2 & multicolumn2cmakecellline1 \ line2 \ line3 \
                  addlinespace
                  multirowthead3Test 3 & line1 & line1 \
                  & line2 & line2 \
                  & line3 & line 3\
                  addlinespace
                  multirowthead3Test 4 & line1 & line1 \
                  & line2 & line2 \
                  & line3 & line 3\
                  bottomrule
                  endtabular
                  labeltable:mytable
                  captionThis is the caption.labeltable:mytable

                  endtable

                  enddocument


                  enter image description here






                  share|improve this answer













                  A variant code, also based on makecell, combined with multirow – and booktabs, to add some padding around rules. I added some vertical spacing to separate the groups of three lines. Also, a reference to requires a label command (after the caption) to work.



                  documentclassreport
                  usepackagemultirow
                  usepackagemakecell, booktabs
                  renewcommandtheadfontnormalsizebfseries


                  begindocument

                  This is some text and here is a reference to Table reftable:mytable.

                  begintable [h]
                  centering
                  begintabular c c c \
                  textbfColumn A & textbfColumn B & textbfColumn C \
                  midrule
                  multirowthead3Test1 & line1 & line1 \
                  & line2 & line2 \
                  & line3 & line 3\
                  addlinespace
                  textbfTest2 & multicolumn2cmakecellline1 \ line2 \ line3 \
                  addlinespace
                  multirowthead3Test 3 & line1 & line1 \
                  & line2 & line2 \
                  & line3 & line 3\
                  addlinespace
                  multirowthead3Test 4 & line1 & line1 \
                  & line2 & line2 \
                  & line3 & line 3\
                  bottomrule
                  endtabular
                  labeltable:mytable
                  captionThis is the caption.labeltable:mytable

                  endtable

                  enddocument


                  enter image description here







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 7 hours ago









                  BernardBernard

                  189k7 gold badges85 silver badges224 bronze badges




                  189k7 gold badges85 silver badges224 bronze badges























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









                      draft saved

                      draft discarded


















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












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











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














                      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%2f505159%2ftable-caption-in-the-middle-of-the-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

                      Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

                      Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

                      199年 目錄 大件事 到箇年出世嗰人 到箇年死嗰人 節慶、風俗習慣 導覽選單