How to create complicated tables (multiple nested columns and rows)My table doesn't fit; what are my options?Creating tables with spanning rows/columnsTable with multiple rows and columnsTable overlay in beamer on multiple rows and multiple columnsThe table of multiple rows and columnsHow to create a table with varying columns and rowsTables with multiple columnsMissing, number treated as zero. Multiple rows and multiple columnsComplex tables with multiple rows and columns and text in verticalTable with multiple rows and columns, column issueHow to combine multiple rows and columns in tabu environment

Do I have to mention my main characters age?

Three phase systems - are there any single phase devices that are connected between two phases instead of between one phase and neutral?

What is the origin of "Wonder begets wisdom?"

How does mathematics work?

Will copper pour help on my single-layer PCB?

Last-minute canceled work-trip means I'll lose thousands of dollars on planned vacation

What is the difference between uniform velocity and constant velocity?

Why is there an extra "t" in Lemmatization?

Why should fork() have been designed to return a file descriptor?

why neutral does not shock. how can a neutral be neutral in ac current?

What's the physical meaning of the statement that "photons don't have positions"?

What does Windows' "Tuning up Application Start" do?

Ethiopian Airlines tickets seem to always have the same price regardless of the proximity of the date?

What does a Nintendo Game Boy do when turned on without a game cartridge inserted?

Why does airflow separate from the wing during stall?

The most secure way to handle someone forgetting to verify their account?

What does "play in traffic" mean?

What could make large expeditions ineffective for exploring territory full of dangers and valuable resources?

What is the intuition for higher homotopy groups not vanishing?

Improving an O(N^2) function (all entities iterating over all other entities)

Nilpotent elements of Lie algebra and unipotent groups

Redirection operator, standard input and command parameters

Linearize or approximate a square root constraint

Is it ethical to tell my teaching assistant that I like them?



How to create complicated tables (multiple nested columns and rows)


My table doesn't fit; what are my options?Creating tables with spanning rows/columnsTable with multiple rows and columnsTable overlay in beamer on multiple rows and multiple columnsThe table of multiple rows and columnsHow to create a table with varying columns and rowsTables with multiple columnsMissing, number treated as zero. Multiple rows and multiple columnsComplex tables with multiple rows and columns and text in verticalTable with multiple rows and columns, column issueHow to combine multiple rows and columns in tabu environment






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








1















I have an image of a table that I want to replicate but I can't figure out how to do the multiple rows part (see left side of column) and the multiple columns part (see right side).



Is there a general way to do this? How do you go about creating such tables? The numbers are irrelevant, I'm looking for a piece of code that I can easily extend as necessary (add more rows/colums).



Complicated table



Edit:



Thanks to @leandriis, the following works well:



begintabularc
%toprule
Metric & Dataset &
%multicolumn6cSGAN (Ours)\ cmidrule3-8 & &
makecell[b]20V-20 \ (pretrained) & makecell[b]20VP-20 \ (pretrained) & makecell[b]20VP-20 \ (retrained) & makecell[b]Mean \ Pooling & makecell[b]Random \ Pooling & makecell[b]Gumble \ Pooling\
midrule
& ETH & 3 & 3 & 3 \
& ETH & 3 & 3 & 3 \
ADE & ETH & 3 & 3 & 3 \
& ETH & 3 & 3 & 3\
& ETH & 3 & 3 & 3 \
AVG & & 3 & 3 & 3 \
midrulemidrule
& ETH & 3 & 3 & 3 \
& ETH & 3 & 3 & 3 \
ADE & ETH & 3 & 3 & 3 \
& ETH & 3 & 3 & 3\
& ETH & 3 & 3 & 3 \
AVG & & 3 & 3 & 3 \
bottomrulebottomrule
endtabular


Resulting table










share|improve this question



















  • 1





    It is not very hard to do. What have you tried?

    – Bernard
    8 hours ago







  • 1





    Do you need a reproduction of the exact format, or do you prefer a more classic, and nicer, layout?

    – Sveinung
    8 hours ago






  • 1





    My question was if you needed an exact reproduction of you example. Nicer means a classic, formal book style table, without vertical rules, and more space between rows.

    – Sveinung
    8 hours ago






  • 2





    Here at stackexchange. Search on "booktabs". I will give you an example, if not Bernhard or leandriis does it befor me (or Mico)

    – Sveinung
    8 hours ago






  • 1





    begintabularc multirow2*textbfMetric &multirow2*textbfDataset & multirow2*textbfLinear & multirow2*textbfLSTM& multirow2*textbfS-LSTM& multicolumn4ctextbfSGAN (Ours)\&&&&& 1V-I&1V-20&20V20&20VP-20\\hlinehline multirow5*textbfADE& textbfETH & ...& 061 / textbf0.81 & textbf0.60 / 0.87 \ & textbfHOTEL & ... & 0.52 / 0.67 \ This is a code for a simple format without siunitx package and booktabs etc... You just need to complete it and to ad multirow package in your preamble.

    – koleygr
    8 hours ago


















1















I have an image of a table that I want to replicate but I can't figure out how to do the multiple rows part (see left side of column) and the multiple columns part (see right side).



Is there a general way to do this? How do you go about creating such tables? The numbers are irrelevant, I'm looking for a piece of code that I can easily extend as necessary (add more rows/colums).



Complicated table



Edit:



Thanks to @leandriis, the following works well:



begintabularc
%toprule
Metric & Dataset &
%multicolumn6cSGAN (Ours)\ cmidrule3-8 & &
makecell[b]20V-20 \ (pretrained) & makecell[b]20VP-20 \ (pretrained) & makecell[b]20VP-20 \ (retrained) & makecell[b]Mean \ Pooling & makecell[b]Random \ Pooling & makecell[b]Gumble \ Pooling\
midrule
& ETH & 3 & 3 & 3 \
& ETH & 3 & 3 & 3 \
ADE & ETH & 3 & 3 & 3 \
& ETH & 3 & 3 & 3\
& ETH & 3 & 3 & 3 \
AVG & & 3 & 3 & 3 \
midrulemidrule
& ETH & 3 & 3 & 3 \
& ETH & 3 & 3 & 3 \
ADE & ETH & 3 & 3 & 3 \
& ETH & 3 & 3 & 3\
& ETH & 3 & 3 & 3 \
AVG & & 3 & 3 & 3 \
bottomrulebottomrule
endtabular


Resulting table










share|improve this question



















  • 1





    It is not very hard to do. What have you tried?

    – Bernard
    8 hours ago







  • 1





    Do you need a reproduction of the exact format, or do you prefer a more classic, and nicer, layout?

    – Sveinung
    8 hours ago






  • 1





    My question was if you needed an exact reproduction of you example. Nicer means a classic, formal book style table, without vertical rules, and more space between rows.

    – Sveinung
    8 hours ago






  • 2





    Here at stackexchange. Search on "booktabs". I will give you an example, if not Bernhard or leandriis does it befor me (or Mico)

    – Sveinung
    8 hours ago






  • 1





    begintabularc multirow2*textbfMetric &multirow2*textbfDataset & multirow2*textbfLinear & multirow2*textbfLSTM& multirow2*textbfS-LSTM& multicolumn4ctextbfSGAN (Ours)\&&&&& 1V-I&1V-20&20V20&20VP-20\\hlinehline multirow5*textbfADE& textbfETH & ...& 061 / textbf0.81 & textbf0.60 / 0.87 \ & textbfHOTEL & ... & 0.52 / 0.67 \ This is a code for a simple format without siunitx package and booktabs etc... You just need to complete it and to ad multirow package in your preamble.

    – koleygr
    8 hours ago














1












1








1








I have an image of a table that I want to replicate but I can't figure out how to do the multiple rows part (see left side of column) and the multiple columns part (see right side).



Is there a general way to do this? How do you go about creating such tables? The numbers are irrelevant, I'm looking for a piece of code that I can easily extend as necessary (add more rows/colums).



Complicated table



Edit:



Thanks to @leandriis, the following works well:



begintabularc
%toprule
Metric & Dataset &
%multicolumn6cSGAN (Ours)\ cmidrule3-8 & &
makecell[b]20V-20 \ (pretrained) & makecell[b]20VP-20 \ (pretrained) & makecell[b]20VP-20 \ (retrained) & makecell[b]Mean \ Pooling & makecell[b]Random \ Pooling & makecell[b]Gumble \ Pooling\
midrule
& ETH & 3 & 3 & 3 \
& ETH & 3 & 3 & 3 \
ADE & ETH & 3 & 3 & 3 \
& ETH & 3 & 3 & 3\
& ETH & 3 & 3 & 3 \
AVG & & 3 & 3 & 3 \
midrulemidrule
& ETH & 3 & 3 & 3 \
& ETH & 3 & 3 & 3 \
ADE & ETH & 3 & 3 & 3 \
& ETH & 3 & 3 & 3\
& ETH & 3 & 3 & 3 \
AVG & & 3 & 3 & 3 \
bottomrulebottomrule
endtabular


Resulting table










share|improve this question
















I have an image of a table that I want to replicate but I can't figure out how to do the multiple rows part (see left side of column) and the multiple columns part (see right side).



Is there a general way to do this? How do you go about creating such tables? The numbers are irrelevant, I'm looking for a piece of code that I can easily extend as necessary (add more rows/colums).



Complicated table



Edit:



Thanks to @leandriis, the following works well:



begintabularc
%toprule
Metric & Dataset &
%multicolumn6cSGAN (Ours)\ cmidrule3-8 & &
makecell[b]20V-20 \ (pretrained) & makecell[b]20VP-20 \ (pretrained) & makecell[b]20VP-20 \ (retrained) & makecell[b]Mean \ Pooling & makecell[b]Random \ Pooling & makecell[b]Gumble \ Pooling\
midrule
& ETH & 3 & 3 & 3 \
& ETH & 3 & 3 & 3 \
ADE & ETH & 3 & 3 & 3 \
& ETH & 3 & 3 & 3\
& ETH & 3 & 3 & 3 \
AVG & & 3 & 3 & 3 \
midrulemidrule
& ETH & 3 & 3 & 3 \
& ETH & 3 & 3 & 3 \
ADE & ETH & 3 & 3 & 3 \
& ETH & 3 & 3 & 3\
& ETH & 3 & 3 & 3 \
AVG & & 3 & 3 & 3 \
bottomrulebottomrule
endtabular


Resulting table







tables






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 6 hours ago







Anna Vopureta

















asked 8 hours ago









Anna VopuretaAnna Vopureta

1105 bronze badges




1105 bronze badges







  • 1





    It is not very hard to do. What have you tried?

    – Bernard
    8 hours ago







  • 1





    Do you need a reproduction of the exact format, or do you prefer a more classic, and nicer, layout?

    – Sveinung
    8 hours ago






  • 1





    My question was if you needed an exact reproduction of you example. Nicer means a classic, formal book style table, without vertical rules, and more space between rows.

    – Sveinung
    8 hours ago






  • 2





    Here at stackexchange. Search on "booktabs". I will give you an example, if not Bernhard or leandriis does it befor me (or Mico)

    – Sveinung
    8 hours ago






  • 1





    begintabularc multirow2*textbfMetric &multirow2*textbfDataset & multirow2*textbfLinear & multirow2*textbfLSTM& multirow2*textbfS-LSTM& multicolumn4ctextbfSGAN (Ours)\&&&&& 1V-I&1V-20&20V20&20VP-20\\hlinehline multirow5*textbfADE& textbfETH & ...& 061 / textbf0.81 & textbf0.60 / 0.87 \ & textbfHOTEL & ... & 0.52 / 0.67 \ This is a code for a simple format without siunitx package and booktabs etc... You just need to complete it and to ad multirow package in your preamble.

    – koleygr
    8 hours ago













  • 1





    It is not very hard to do. What have you tried?

    – Bernard
    8 hours ago







  • 1





    Do you need a reproduction of the exact format, or do you prefer a more classic, and nicer, layout?

    – Sveinung
    8 hours ago






  • 1





    My question was if you needed an exact reproduction of you example. Nicer means a classic, formal book style table, without vertical rules, and more space between rows.

    – Sveinung
    8 hours ago






  • 2





    Here at stackexchange. Search on "booktabs". I will give you an example, if not Bernhard or leandriis does it befor me (or Mico)

    – Sveinung
    8 hours ago






  • 1





    begintabularc multirow2*textbfMetric &multirow2*textbfDataset & multirow2*textbfLinear & multirow2*textbfLSTM& multirow2*textbfS-LSTM& multicolumn4ctextbfSGAN (Ours)\&&&&& 1V-I&1V-20&20V20&20VP-20\\hlinehline multirow5*textbfADE& textbfETH & ...& 061 / textbf0.81 & textbf0.60 / 0.87 \ & textbfHOTEL & ... & 0.52 / 0.67 \ This is a code for a simple format without siunitx package and booktabs etc... You just need to complete it and to ad multirow package in your preamble.

    – koleygr
    8 hours ago








1




1





It is not very hard to do. What have you tried?

– Bernard
8 hours ago






It is not very hard to do. What have you tried?

– Bernard
8 hours ago





1




1





Do you need a reproduction of the exact format, or do you prefer a more classic, and nicer, layout?

– Sveinung
8 hours ago





Do you need a reproduction of the exact format, or do you prefer a more classic, and nicer, layout?

– Sveinung
8 hours ago




1




1





My question was if you needed an exact reproduction of you example. Nicer means a classic, formal book style table, without vertical rules, and more space between rows.

– Sveinung
8 hours ago





My question was if you needed an exact reproduction of you example. Nicer means a classic, formal book style table, without vertical rules, and more space between rows.

– Sveinung
8 hours ago




2




2





Here at stackexchange. Search on "booktabs". I will give you an example, if not Bernhard or leandriis does it befor me (or Mico)

– Sveinung
8 hours ago





Here at stackexchange. Search on "booktabs". I will give you an example, if not Bernhard or leandriis does it befor me (or Mico)

– Sveinung
8 hours ago




1




1





begintabularc multirow2*textbfMetric &multirow2*textbfDataset & multirow2*textbfLinear & multirow2*textbfLSTM& multirow2*textbfS-LSTM& multicolumn4ctextbfSGAN (Ours)\&&&&& 1V-I&1V-20&20V20&20VP-20\\hlinehline multirow5*textbfADE& textbfETH & ...& 061 / textbf0.81 & textbf0.60 / 0.87 \ & textbfHOTEL & ... & 0.52 / 0.67 \ This is a code for a simple format without siunitx package and booktabs etc... You just need to complete it and to ad multirow package in your preamble.

– koleygr
8 hours ago






begintabularc multirow2*textbfMetric &multirow2*textbfDataset & multirow2*textbfLinear & multirow2*textbfLSTM& multirow2*textbfS-LSTM& multicolumn4ctextbfSGAN (Ours)\&&&&& 1V-I&1V-20&20V20&20VP-20\\hlinehline multirow5*textbfADE& textbfETH & ...& 061 / textbf0.81 & textbf0.60 / 0.87 \ & textbfHOTEL & ... & 0.52 / 0.67 \ This is a code for a simple format without siunitx package and booktabs etc... You just need to complete it and to ad multirow package in your preamble.

– koleygr
8 hours ago











2 Answers
2






active

oldest

votes


















2














Here is a short code, that might serve as a place to start from. I have included some multicolumn an multirow commands in order to get the alignment that was mentioned in the question.



documentclassarticle
usepackagemultirow
begindocument

begintabularc
multirow2*textbfMetric & multirow2*textbfDataset &
multicolumn3ctextbfSGAN (Ours)\
& & 1V-1 & 1V-20 & 20V-20\
hline hline
& textbfETH & 3 & 3 & 3 \
& textbfETH & 3 & 3 & 3 \
ADE & textbfETH & 3 & 3 & 3 \
& textbfETH & 3 & 3 & 3\
& textbfETH & 3 & 3 & 3 \
hline
textbfAVG & & & & \
hlinehline
& textbfETH & 3 & 3 & 3 \
& textbfETH & 3 & 3 & 3 \
ADE & textbfETH & 3 & 3 & 3 \
& textbfETH & 3 & 3 & 3\
& textbfETH & 3 & 3 & 3 \
hline
textbfAVG & & & &
endtabular

enddocument


Here is also a suggestion on how to use the booktabs package in order to create a table that has no vertical and just a few horizontal lines with some additional white space around them. I'd also suggest to not use bold for the column headers and the contents of the first/second column:



documentclassarticle
usepackagebooktabs

begindocument

begintabularccccc
toprule
Metric & Dataset &
multicolumn3cSGAN (Ours)\ cmidrule3-5
& & 1V-1 & 1V-20 & 20V-20\
midrule
ADE & ETH & 3 & 3 & 3 \
& ETH & 3 & 3 & 3 \
& ETH & 3 & 3 & 3 \
& ETH & 3 & 3 & 3\
& ETH & 3 & 3 & 3 \
AVG & & 3 & 3 & 3 \
midrule
ADE & ETH & 3 & 3 & 3 \
& ETH & 3 & 3 & 3 \
& ETH & 3 & 3 & 3 \
& ETH & 3 & 3 & 3\
& ETH & 3 & 3 & 3 \
AVG & & 3 & 3 & 3 \
bottomrule
endtabular

enddocument


Here is a comparison of both tables side by side:



enter image description here



For an improved alignment of the numbers in column 3-9 I'd suggest tue usage of the siunitx package.






share|improve this answer

























  • Is there a reason you left out lines between for example "Metric" and "Dataset" or "ADE and "AVG"?

    – Anna Vopureta
    7 hours ago











  • @AnnaVopureta: Do you refer to the vertical lines that I completely removed in my second example? If so, this is due to the "more classic, and nicer, layout" that Sveinung already mentioned/explained in their comment.

    – leandriis
    7 hours ago






  • 3





    @AnnaVopureta: Personally, I don't agree that vertical lines would be useful in this table. But if you prefer to have them, you can use | inbetween the column specifiers (begintabularcc without line and begintabularcwith vertical line) just as in the first example. Please also note, that booktabs lines are incompatible with vertical lines, so it might be better to stay with the first example code (usage of hline) then.

    – leandriis
    7 hours ago







  • 1





    @AnnaVopureta: Please have a closer look at the intersections of the horizontal and vertical lines if you add | to the second example. You will notice that there is a small white space in the vertical lines. This is due to the booktabs rules being incompatible with vertical lines.

    – leandriis
    7 hours ago







  • 1





    @AnnaVopureta: Sorry for the typo, I meant multirow5*ADE. This should work. Alternatively, you can also go without multirow if you move the text "ADE" two rows down (to the third row of the respective block of five rows) as I have done in the first example code.

    – leandriis
    7 hours ago


















1














Here is your tabular typeset approximately how I would have done in my documents. However, I would prefer small capital letters and italic instead of bold to emphasise headings and numbers. I increased the margins so the tabular fits between the margin.



In the preamble, I have used three commands to change the tabular's spacing:



setlengthextrarowheight1pt
renewcommandarraystretch1.1
setlengthtabcolsep4pt


The first moves the cell content a little bit down. The second increases the spacining between rows (creates some air). And the third decrease the spacing between columns.



I have removed all vertical rules and used heavier rules and added space instead of double rules, all according to recommendation in the booktabs manual. That package is used to typeset all rules, so you have suitable distance between rules and cell content. I have also use the array package to have more flexible commands.



NB! The booktabs manual is a must read if you want to typeset nice tabulars.



As you also will see, I use two right align column to typeset the number. Since all cells have the same number of decimals, you can use simple r-columns in combination with a array-trick to typeset 1.21 / 2.35. To typeset slash between the two columns of numbers, I use `r@,/,r, which removes all space between the two columns and replace it with small two tiny spaces and the slash.



In the heading I have moved together two columns using multicolumn.



enter image description here



documentclassarticle
usepackage[left=1.5cm, right=1.5cm]geometry
usepackagearray, booktabs

setlengthextrarowheight1pt
renewcommandarraystretch1.1
setlengthtabcolsep4pt

begindocument

begintabular@c>bfseriesc r@,/,r r@,/,r r@,/,r r@,/,r r@,/,r r@,/,r r@,/,r@

&&multicolumn6c&multicolumn8c@textbfSGAN (Ours) \cmidrule(l)9-16
textbfMetric & textbfDataset & multicolumn2ctextbfLinear&multicolumn2ctextbfLSTM&multicolumn2ctextbfS-LSTM&multicolumn2c1V-1&multicolumn2c1V-20&multicolumn2c20V-20&multicolumn2c@20VP-20 \midrule
&ETC&0.84&1.33&0.70&1.09&0.73&1.09&0.79&1.13&0.75&1.03&0.61&textbf0.81&textbf0.60&0.87 \
&HOTEL&textbf0.35&textbf0.39&0.55&0.86&0.49&079&0.71&1.01&0.63&0.90&0.48&0.72&0.52&0.67 \
ADE&UNIV&0.56&0.82&0.36&0.61&0.41&0.67&0.37&0.60&0.36&0.58&textbf0.36&textbf0.60&0.44&0.76 \
&ZARA1&0.41&0.62&0.25&0.41&0.27&0.47&0.25&0.42&0.23&0.38&textbf0.21&textbf0.34&0.22&0.35 \
&ZARA2&0.53&0.77&0.31&0.52&0.33&0.56&0.32&0.52&0.29&0.47&textbf0.27&0.42&0.29&textbf0.42 \midrule
multicolumn1@ltextbfAVG&&0.54&0.79&0.43&0.70&0.45&0.72&0.49&0.74&0.45&0.67&textbf0.39&textbf0.58&0.41&0.61 \bottomruleaddlinespace[1ex]
&ETC&1.60&2.94&1.45&2.41&1.48&2.35&1.61&2.21&1.52&2.02&1.22&textbf1.52&textbf1.19&1.62 \
&HOTEL&textbf0.60&textbf0.72&1.17&.1.91&1.01&1.76&1.44&2.18&1.32&1.97&0.95&1.61&1.02&1.37 \
FDE&UNIV&1.01&1.59&0.77&1.31&0.84&1.40&0.75&1.28&textbf0.73&textbf1.22&0.75&1.26&0.84&1.52 \
&ZARA1&0.74&1.21&0.53&0.88&0.56&1.00&0.53&0.91&0.48&0.84&textbf0.42&0.69&0.43&textbf0.68 \
&ZARA2&0.95&1.48&0.65&1.11&0.70&1.17&0.66&1.11&0.61&1.01&textbf0.54&textbf0.84&0.58&0.84 \midrule
multicolumn1@ltextbfAVG&&0.98&1.59&0.91&1.52&0.91&1.54&1.00&1.54&0.93&1.41&textbf0.78&textbf1.18&0.81&1.21 \bottomrule

endtabular
enddocument





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%2f500838%2fhow-to-create-complicated-tables-multiple-nested-columns-and-rows%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    Here is a short code, that might serve as a place to start from. I have included some multicolumn an multirow commands in order to get the alignment that was mentioned in the question.



    documentclassarticle
    usepackagemultirow
    begindocument

    begintabularc
    multirow2*textbfMetric & multirow2*textbfDataset &
    multicolumn3ctextbfSGAN (Ours)\
    & & 1V-1 & 1V-20 & 20V-20\
    hline hline
    & textbfETH & 3 & 3 & 3 \
    & textbfETH & 3 & 3 & 3 \
    ADE & textbfETH & 3 & 3 & 3 \
    & textbfETH & 3 & 3 & 3\
    & textbfETH & 3 & 3 & 3 \
    hline
    textbfAVG & & & & \
    hlinehline
    & textbfETH & 3 & 3 & 3 \
    & textbfETH & 3 & 3 & 3 \
    ADE & textbfETH & 3 & 3 & 3 \
    & textbfETH & 3 & 3 & 3\
    & textbfETH & 3 & 3 & 3 \
    hline
    textbfAVG & & & &
    endtabular

    enddocument


    Here is also a suggestion on how to use the booktabs package in order to create a table that has no vertical and just a few horizontal lines with some additional white space around them. I'd also suggest to not use bold for the column headers and the contents of the first/second column:



    documentclassarticle
    usepackagebooktabs

    begindocument

    begintabularccccc
    toprule
    Metric & Dataset &
    multicolumn3cSGAN (Ours)\ cmidrule3-5
    & & 1V-1 & 1V-20 & 20V-20\
    midrule
    ADE & ETH & 3 & 3 & 3 \
    & ETH & 3 & 3 & 3 \
    & ETH & 3 & 3 & 3 \
    & ETH & 3 & 3 & 3\
    & ETH & 3 & 3 & 3 \
    AVG & & 3 & 3 & 3 \
    midrule
    ADE & ETH & 3 & 3 & 3 \
    & ETH & 3 & 3 & 3 \
    & ETH & 3 & 3 & 3 \
    & ETH & 3 & 3 & 3\
    & ETH & 3 & 3 & 3 \
    AVG & & 3 & 3 & 3 \
    bottomrule
    endtabular

    enddocument


    Here is a comparison of both tables side by side:



    enter image description here



    For an improved alignment of the numbers in column 3-9 I'd suggest tue usage of the siunitx package.






    share|improve this answer

























    • Is there a reason you left out lines between for example "Metric" and "Dataset" or "ADE and "AVG"?

      – Anna Vopureta
      7 hours ago











    • @AnnaVopureta: Do you refer to the vertical lines that I completely removed in my second example? If so, this is due to the "more classic, and nicer, layout" that Sveinung already mentioned/explained in their comment.

      – leandriis
      7 hours ago






    • 3





      @AnnaVopureta: Personally, I don't agree that vertical lines would be useful in this table. But if you prefer to have them, you can use | inbetween the column specifiers (begintabularcc without line and begintabularcwith vertical line) just as in the first example. Please also note, that booktabs lines are incompatible with vertical lines, so it might be better to stay with the first example code (usage of hline) then.

      – leandriis
      7 hours ago







    • 1





      @AnnaVopureta: Please have a closer look at the intersections of the horizontal and vertical lines if you add | to the second example. You will notice that there is a small white space in the vertical lines. This is due to the booktabs rules being incompatible with vertical lines.

      – leandriis
      7 hours ago







    • 1





      @AnnaVopureta: Sorry for the typo, I meant multirow5*ADE. This should work. Alternatively, you can also go without multirow if you move the text "ADE" two rows down (to the third row of the respective block of five rows) as I have done in the first example code.

      – leandriis
      7 hours ago















    2














    Here is a short code, that might serve as a place to start from. I have included some multicolumn an multirow commands in order to get the alignment that was mentioned in the question.



    documentclassarticle
    usepackagemultirow
    begindocument

    begintabularc
    multirow2*textbfMetric & multirow2*textbfDataset &
    multicolumn3ctextbfSGAN (Ours)\
    & & 1V-1 & 1V-20 & 20V-20\
    hline hline
    & textbfETH & 3 & 3 & 3 \
    & textbfETH & 3 & 3 & 3 \
    ADE & textbfETH & 3 & 3 & 3 \
    & textbfETH & 3 & 3 & 3\
    & textbfETH & 3 & 3 & 3 \
    hline
    textbfAVG & & & & \
    hlinehline
    & textbfETH & 3 & 3 & 3 \
    & textbfETH & 3 & 3 & 3 \
    ADE & textbfETH & 3 & 3 & 3 \
    & textbfETH & 3 & 3 & 3\
    & textbfETH & 3 & 3 & 3 \
    hline
    textbfAVG & & & &
    endtabular

    enddocument


    Here is also a suggestion on how to use the booktabs package in order to create a table that has no vertical and just a few horizontal lines with some additional white space around them. I'd also suggest to not use bold for the column headers and the contents of the first/second column:



    documentclassarticle
    usepackagebooktabs

    begindocument

    begintabularccccc
    toprule
    Metric & Dataset &
    multicolumn3cSGAN (Ours)\ cmidrule3-5
    & & 1V-1 & 1V-20 & 20V-20\
    midrule
    ADE & ETH & 3 & 3 & 3 \
    & ETH & 3 & 3 & 3 \
    & ETH & 3 & 3 & 3 \
    & ETH & 3 & 3 & 3\
    & ETH & 3 & 3 & 3 \
    AVG & & 3 & 3 & 3 \
    midrule
    ADE & ETH & 3 & 3 & 3 \
    & ETH & 3 & 3 & 3 \
    & ETH & 3 & 3 & 3 \
    & ETH & 3 & 3 & 3\
    & ETH & 3 & 3 & 3 \
    AVG & & 3 & 3 & 3 \
    bottomrule
    endtabular

    enddocument


    Here is a comparison of both tables side by side:



    enter image description here



    For an improved alignment of the numbers in column 3-9 I'd suggest tue usage of the siunitx package.






    share|improve this answer

























    • Is there a reason you left out lines between for example "Metric" and "Dataset" or "ADE and "AVG"?

      – Anna Vopureta
      7 hours ago











    • @AnnaVopureta: Do you refer to the vertical lines that I completely removed in my second example? If so, this is due to the "more classic, and nicer, layout" that Sveinung already mentioned/explained in their comment.

      – leandriis
      7 hours ago






    • 3





      @AnnaVopureta: Personally, I don't agree that vertical lines would be useful in this table. But if you prefer to have them, you can use | inbetween the column specifiers (begintabularcc without line and begintabularcwith vertical line) just as in the first example. Please also note, that booktabs lines are incompatible with vertical lines, so it might be better to stay with the first example code (usage of hline) then.

      – leandriis
      7 hours ago







    • 1





      @AnnaVopureta: Please have a closer look at the intersections of the horizontal and vertical lines if you add | to the second example. You will notice that there is a small white space in the vertical lines. This is due to the booktabs rules being incompatible with vertical lines.

      – leandriis
      7 hours ago







    • 1





      @AnnaVopureta: Sorry for the typo, I meant multirow5*ADE. This should work. Alternatively, you can also go without multirow if you move the text "ADE" two rows down (to the third row of the respective block of five rows) as I have done in the first example code.

      – leandriis
      7 hours ago













    2












    2








    2







    Here is a short code, that might serve as a place to start from. I have included some multicolumn an multirow commands in order to get the alignment that was mentioned in the question.



    documentclassarticle
    usepackagemultirow
    begindocument

    begintabularc
    multirow2*textbfMetric & multirow2*textbfDataset &
    multicolumn3ctextbfSGAN (Ours)\
    & & 1V-1 & 1V-20 & 20V-20\
    hline hline
    & textbfETH & 3 & 3 & 3 \
    & textbfETH & 3 & 3 & 3 \
    ADE & textbfETH & 3 & 3 & 3 \
    & textbfETH & 3 & 3 & 3\
    & textbfETH & 3 & 3 & 3 \
    hline
    textbfAVG & & & & \
    hlinehline
    & textbfETH & 3 & 3 & 3 \
    & textbfETH & 3 & 3 & 3 \
    ADE & textbfETH & 3 & 3 & 3 \
    & textbfETH & 3 & 3 & 3\
    & textbfETH & 3 & 3 & 3 \
    hline
    textbfAVG & & & &
    endtabular

    enddocument


    Here is also a suggestion on how to use the booktabs package in order to create a table that has no vertical and just a few horizontal lines with some additional white space around them. I'd also suggest to not use bold for the column headers and the contents of the first/second column:



    documentclassarticle
    usepackagebooktabs

    begindocument

    begintabularccccc
    toprule
    Metric & Dataset &
    multicolumn3cSGAN (Ours)\ cmidrule3-5
    & & 1V-1 & 1V-20 & 20V-20\
    midrule
    ADE & ETH & 3 & 3 & 3 \
    & ETH & 3 & 3 & 3 \
    & ETH & 3 & 3 & 3 \
    & ETH & 3 & 3 & 3\
    & ETH & 3 & 3 & 3 \
    AVG & & 3 & 3 & 3 \
    midrule
    ADE & ETH & 3 & 3 & 3 \
    & ETH & 3 & 3 & 3 \
    & ETH & 3 & 3 & 3 \
    & ETH & 3 & 3 & 3\
    & ETH & 3 & 3 & 3 \
    AVG & & 3 & 3 & 3 \
    bottomrule
    endtabular

    enddocument


    Here is a comparison of both tables side by side:



    enter image description here



    For an improved alignment of the numbers in column 3-9 I'd suggest tue usage of the siunitx package.






    share|improve this answer















    Here is a short code, that might serve as a place to start from. I have included some multicolumn an multirow commands in order to get the alignment that was mentioned in the question.



    documentclassarticle
    usepackagemultirow
    begindocument

    begintabularc
    multirow2*textbfMetric & multirow2*textbfDataset &
    multicolumn3ctextbfSGAN (Ours)\
    & & 1V-1 & 1V-20 & 20V-20\
    hline hline
    & textbfETH & 3 & 3 & 3 \
    & textbfETH & 3 & 3 & 3 \
    ADE & textbfETH & 3 & 3 & 3 \
    & textbfETH & 3 & 3 & 3\
    & textbfETH & 3 & 3 & 3 \
    hline
    textbfAVG & & & & \
    hlinehline
    & textbfETH & 3 & 3 & 3 \
    & textbfETH & 3 & 3 & 3 \
    ADE & textbfETH & 3 & 3 & 3 \
    & textbfETH & 3 & 3 & 3\
    & textbfETH & 3 & 3 & 3 \
    hline
    textbfAVG & & & &
    endtabular

    enddocument


    Here is also a suggestion on how to use the booktabs package in order to create a table that has no vertical and just a few horizontal lines with some additional white space around them. I'd also suggest to not use bold for the column headers and the contents of the first/second column:



    documentclassarticle
    usepackagebooktabs

    begindocument

    begintabularccccc
    toprule
    Metric & Dataset &
    multicolumn3cSGAN (Ours)\ cmidrule3-5
    & & 1V-1 & 1V-20 & 20V-20\
    midrule
    ADE & ETH & 3 & 3 & 3 \
    & ETH & 3 & 3 & 3 \
    & ETH & 3 & 3 & 3 \
    & ETH & 3 & 3 & 3\
    & ETH & 3 & 3 & 3 \
    AVG & & 3 & 3 & 3 \
    midrule
    ADE & ETH & 3 & 3 & 3 \
    & ETH & 3 & 3 & 3 \
    & ETH & 3 & 3 & 3 \
    & ETH & 3 & 3 & 3\
    & ETH & 3 & 3 & 3 \
    AVG & & 3 & 3 & 3 \
    bottomrule
    endtabular

    enddocument


    Here is a comparison of both tables side by side:



    enter image description here



    For an improved alignment of the numbers in column 3-9 I'd suggest tue usage of the siunitx package.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited 7 hours ago

























    answered 7 hours ago









    leandriisleandriis

    16.5k1 gold badge11 silver badges36 bronze badges




    16.5k1 gold badge11 silver badges36 bronze badges












    • Is there a reason you left out lines between for example "Metric" and "Dataset" or "ADE and "AVG"?

      – Anna Vopureta
      7 hours ago











    • @AnnaVopureta: Do you refer to the vertical lines that I completely removed in my second example? If so, this is due to the "more classic, and nicer, layout" that Sveinung already mentioned/explained in their comment.

      – leandriis
      7 hours ago






    • 3





      @AnnaVopureta: Personally, I don't agree that vertical lines would be useful in this table. But if you prefer to have them, you can use | inbetween the column specifiers (begintabularcc without line and begintabularcwith vertical line) just as in the first example. Please also note, that booktabs lines are incompatible with vertical lines, so it might be better to stay with the first example code (usage of hline) then.

      – leandriis
      7 hours ago







    • 1





      @AnnaVopureta: Please have a closer look at the intersections of the horizontal and vertical lines if you add | to the second example. You will notice that there is a small white space in the vertical lines. This is due to the booktabs rules being incompatible with vertical lines.

      – leandriis
      7 hours ago







    • 1





      @AnnaVopureta: Sorry for the typo, I meant multirow5*ADE. This should work. Alternatively, you can also go without multirow if you move the text "ADE" two rows down (to the third row of the respective block of five rows) as I have done in the first example code.

      – leandriis
      7 hours ago

















    • Is there a reason you left out lines between for example "Metric" and "Dataset" or "ADE and "AVG"?

      – Anna Vopureta
      7 hours ago











    • @AnnaVopureta: Do you refer to the vertical lines that I completely removed in my second example? If so, this is due to the "more classic, and nicer, layout" that Sveinung already mentioned/explained in their comment.

      – leandriis
      7 hours ago






    • 3





      @AnnaVopureta: Personally, I don't agree that vertical lines would be useful in this table. But if you prefer to have them, you can use | inbetween the column specifiers (begintabularcc without line and begintabularcwith vertical line) just as in the first example. Please also note, that booktabs lines are incompatible with vertical lines, so it might be better to stay with the first example code (usage of hline) then.

      – leandriis
      7 hours ago







    • 1





      @AnnaVopureta: Please have a closer look at the intersections of the horizontal and vertical lines if you add | to the second example. You will notice that there is a small white space in the vertical lines. This is due to the booktabs rules being incompatible with vertical lines.

      – leandriis
      7 hours ago







    • 1





      @AnnaVopureta: Sorry for the typo, I meant multirow5*ADE. This should work. Alternatively, you can also go without multirow if you move the text "ADE" two rows down (to the third row of the respective block of five rows) as I have done in the first example code.

      – leandriis
      7 hours ago
















    Is there a reason you left out lines between for example "Metric" and "Dataset" or "ADE and "AVG"?

    – Anna Vopureta
    7 hours ago





    Is there a reason you left out lines between for example "Metric" and "Dataset" or "ADE and "AVG"?

    – Anna Vopureta
    7 hours ago













    @AnnaVopureta: Do you refer to the vertical lines that I completely removed in my second example? If so, this is due to the "more classic, and nicer, layout" that Sveinung already mentioned/explained in their comment.

    – leandriis
    7 hours ago





    @AnnaVopureta: Do you refer to the vertical lines that I completely removed in my second example? If so, this is due to the "more classic, and nicer, layout" that Sveinung already mentioned/explained in their comment.

    – leandriis
    7 hours ago




    3




    3





    @AnnaVopureta: Personally, I don't agree that vertical lines would be useful in this table. But if you prefer to have them, you can use | inbetween the column specifiers (begintabularcc without line and begintabularcwith vertical line) just as in the first example. Please also note, that booktabs lines are incompatible with vertical lines, so it might be better to stay with the first example code (usage of hline) then.

    – leandriis
    7 hours ago






    @AnnaVopureta: Personally, I don't agree that vertical lines would be useful in this table. But if you prefer to have them, you can use | inbetween the column specifiers (begintabularcc without line and begintabularcwith vertical line) just as in the first example. Please also note, that booktabs lines are incompatible with vertical lines, so it might be better to stay with the first example code (usage of hline) then.

    – leandriis
    7 hours ago





    1




    1





    @AnnaVopureta: Please have a closer look at the intersections of the horizontal and vertical lines if you add | to the second example. You will notice that there is a small white space in the vertical lines. This is due to the booktabs rules being incompatible with vertical lines.

    – leandriis
    7 hours ago






    @AnnaVopureta: Please have a closer look at the intersections of the horizontal and vertical lines if you add | to the second example. You will notice that there is a small white space in the vertical lines. This is due to the booktabs rules being incompatible with vertical lines.

    – leandriis
    7 hours ago





    1




    1





    @AnnaVopureta: Sorry for the typo, I meant multirow5*ADE. This should work. Alternatively, you can also go without multirow if you move the text "ADE" two rows down (to the third row of the respective block of five rows) as I have done in the first example code.

    – leandriis
    7 hours ago





    @AnnaVopureta: Sorry for the typo, I meant multirow5*ADE. This should work. Alternatively, you can also go without multirow if you move the text "ADE" two rows down (to the third row of the respective block of five rows) as I have done in the first example code.

    – leandriis
    7 hours ago













    1














    Here is your tabular typeset approximately how I would have done in my documents. However, I would prefer small capital letters and italic instead of bold to emphasise headings and numbers. I increased the margins so the tabular fits between the margin.



    In the preamble, I have used three commands to change the tabular's spacing:



    setlengthextrarowheight1pt
    renewcommandarraystretch1.1
    setlengthtabcolsep4pt


    The first moves the cell content a little bit down. The second increases the spacining between rows (creates some air). And the third decrease the spacing between columns.



    I have removed all vertical rules and used heavier rules and added space instead of double rules, all according to recommendation in the booktabs manual. That package is used to typeset all rules, so you have suitable distance between rules and cell content. I have also use the array package to have more flexible commands.



    NB! The booktabs manual is a must read if you want to typeset nice tabulars.



    As you also will see, I use two right align column to typeset the number. Since all cells have the same number of decimals, you can use simple r-columns in combination with a array-trick to typeset 1.21 / 2.35. To typeset slash between the two columns of numbers, I use `r@,/,r, which removes all space between the two columns and replace it with small two tiny spaces and the slash.



    In the heading I have moved together two columns using multicolumn.



    enter image description here



    documentclassarticle
    usepackage[left=1.5cm, right=1.5cm]geometry
    usepackagearray, booktabs

    setlengthextrarowheight1pt
    renewcommandarraystretch1.1
    setlengthtabcolsep4pt

    begindocument

    begintabular@c>bfseriesc r@,/,r r@,/,r r@,/,r r@,/,r r@,/,r r@,/,r r@,/,r@

    &&multicolumn6c&multicolumn8c@textbfSGAN (Ours) \cmidrule(l)9-16
    textbfMetric & textbfDataset & multicolumn2ctextbfLinear&multicolumn2ctextbfLSTM&multicolumn2ctextbfS-LSTM&multicolumn2c1V-1&multicolumn2c1V-20&multicolumn2c20V-20&multicolumn2c@20VP-20 \midrule
    &ETC&0.84&1.33&0.70&1.09&0.73&1.09&0.79&1.13&0.75&1.03&0.61&textbf0.81&textbf0.60&0.87 \
    &HOTEL&textbf0.35&textbf0.39&0.55&0.86&0.49&079&0.71&1.01&0.63&0.90&0.48&0.72&0.52&0.67 \
    ADE&UNIV&0.56&0.82&0.36&0.61&0.41&0.67&0.37&0.60&0.36&0.58&textbf0.36&textbf0.60&0.44&0.76 \
    &ZARA1&0.41&0.62&0.25&0.41&0.27&0.47&0.25&0.42&0.23&0.38&textbf0.21&textbf0.34&0.22&0.35 \
    &ZARA2&0.53&0.77&0.31&0.52&0.33&0.56&0.32&0.52&0.29&0.47&textbf0.27&0.42&0.29&textbf0.42 \midrule
    multicolumn1@ltextbfAVG&&0.54&0.79&0.43&0.70&0.45&0.72&0.49&0.74&0.45&0.67&textbf0.39&textbf0.58&0.41&0.61 \bottomruleaddlinespace[1ex]
    &ETC&1.60&2.94&1.45&2.41&1.48&2.35&1.61&2.21&1.52&2.02&1.22&textbf1.52&textbf1.19&1.62 \
    &HOTEL&textbf0.60&textbf0.72&1.17&.1.91&1.01&1.76&1.44&2.18&1.32&1.97&0.95&1.61&1.02&1.37 \
    FDE&UNIV&1.01&1.59&0.77&1.31&0.84&1.40&0.75&1.28&textbf0.73&textbf1.22&0.75&1.26&0.84&1.52 \
    &ZARA1&0.74&1.21&0.53&0.88&0.56&1.00&0.53&0.91&0.48&0.84&textbf0.42&0.69&0.43&textbf0.68 \
    &ZARA2&0.95&1.48&0.65&1.11&0.70&1.17&0.66&1.11&0.61&1.01&textbf0.54&textbf0.84&0.58&0.84 \midrule
    multicolumn1@ltextbfAVG&&0.98&1.59&0.91&1.52&0.91&1.54&1.00&1.54&0.93&1.41&textbf0.78&textbf1.18&0.81&1.21 \bottomrule

    endtabular
    enddocument





    share|improve this answer





























      1














      Here is your tabular typeset approximately how I would have done in my documents. However, I would prefer small capital letters and italic instead of bold to emphasise headings and numbers. I increased the margins so the tabular fits between the margin.



      In the preamble, I have used three commands to change the tabular's spacing:



      setlengthextrarowheight1pt
      renewcommandarraystretch1.1
      setlengthtabcolsep4pt


      The first moves the cell content a little bit down. The second increases the spacining between rows (creates some air). And the third decrease the spacing between columns.



      I have removed all vertical rules and used heavier rules and added space instead of double rules, all according to recommendation in the booktabs manual. That package is used to typeset all rules, so you have suitable distance between rules and cell content. I have also use the array package to have more flexible commands.



      NB! The booktabs manual is a must read if you want to typeset nice tabulars.



      As you also will see, I use two right align column to typeset the number. Since all cells have the same number of decimals, you can use simple r-columns in combination with a array-trick to typeset 1.21 / 2.35. To typeset slash between the two columns of numbers, I use `r@,/,r, which removes all space between the two columns and replace it with small two tiny spaces and the slash.



      In the heading I have moved together two columns using multicolumn.



      enter image description here



      documentclassarticle
      usepackage[left=1.5cm, right=1.5cm]geometry
      usepackagearray, booktabs

      setlengthextrarowheight1pt
      renewcommandarraystretch1.1
      setlengthtabcolsep4pt

      begindocument

      begintabular@c>bfseriesc r@,/,r r@,/,r r@,/,r r@,/,r r@,/,r r@,/,r r@,/,r@

      &&multicolumn6c&multicolumn8c@textbfSGAN (Ours) \cmidrule(l)9-16
      textbfMetric & textbfDataset & multicolumn2ctextbfLinear&multicolumn2ctextbfLSTM&multicolumn2ctextbfS-LSTM&multicolumn2c1V-1&multicolumn2c1V-20&multicolumn2c20V-20&multicolumn2c@20VP-20 \midrule
      &ETC&0.84&1.33&0.70&1.09&0.73&1.09&0.79&1.13&0.75&1.03&0.61&textbf0.81&textbf0.60&0.87 \
      &HOTEL&textbf0.35&textbf0.39&0.55&0.86&0.49&079&0.71&1.01&0.63&0.90&0.48&0.72&0.52&0.67 \
      ADE&UNIV&0.56&0.82&0.36&0.61&0.41&0.67&0.37&0.60&0.36&0.58&textbf0.36&textbf0.60&0.44&0.76 \
      &ZARA1&0.41&0.62&0.25&0.41&0.27&0.47&0.25&0.42&0.23&0.38&textbf0.21&textbf0.34&0.22&0.35 \
      &ZARA2&0.53&0.77&0.31&0.52&0.33&0.56&0.32&0.52&0.29&0.47&textbf0.27&0.42&0.29&textbf0.42 \midrule
      multicolumn1@ltextbfAVG&&0.54&0.79&0.43&0.70&0.45&0.72&0.49&0.74&0.45&0.67&textbf0.39&textbf0.58&0.41&0.61 \bottomruleaddlinespace[1ex]
      &ETC&1.60&2.94&1.45&2.41&1.48&2.35&1.61&2.21&1.52&2.02&1.22&textbf1.52&textbf1.19&1.62 \
      &HOTEL&textbf0.60&textbf0.72&1.17&.1.91&1.01&1.76&1.44&2.18&1.32&1.97&0.95&1.61&1.02&1.37 \
      FDE&UNIV&1.01&1.59&0.77&1.31&0.84&1.40&0.75&1.28&textbf0.73&textbf1.22&0.75&1.26&0.84&1.52 \
      &ZARA1&0.74&1.21&0.53&0.88&0.56&1.00&0.53&0.91&0.48&0.84&textbf0.42&0.69&0.43&textbf0.68 \
      &ZARA2&0.95&1.48&0.65&1.11&0.70&1.17&0.66&1.11&0.61&1.01&textbf0.54&textbf0.84&0.58&0.84 \midrule
      multicolumn1@ltextbfAVG&&0.98&1.59&0.91&1.52&0.91&1.54&1.00&1.54&0.93&1.41&textbf0.78&textbf1.18&0.81&1.21 \bottomrule

      endtabular
      enddocument





      share|improve this answer



























        1












        1








        1







        Here is your tabular typeset approximately how I would have done in my documents. However, I would prefer small capital letters and italic instead of bold to emphasise headings and numbers. I increased the margins so the tabular fits between the margin.



        In the preamble, I have used three commands to change the tabular's spacing:



        setlengthextrarowheight1pt
        renewcommandarraystretch1.1
        setlengthtabcolsep4pt


        The first moves the cell content a little bit down. The second increases the spacining between rows (creates some air). And the third decrease the spacing between columns.



        I have removed all vertical rules and used heavier rules and added space instead of double rules, all according to recommendation in the booktabs manual. That package is used to typeset all rules, so you have suitable distance between rules and cell content. I have also use the array package to have more flexible commands.



        NB! The booktabs manual is a must read if you want to typeset nice tabulars.



        As you also will see, I use two right align column to typeset the number. Since all cells have the same number of decimals, you can use simple r-columns in combination with a array-trick to typeset 1.21 / 2.35. To typeset slash between the two columns of numbers, I use `r@,/,r, which removes all space between the two columns and replace it with small two tiny spaces and the slash.



        In the heading I have moved together two columns using multicolumn.



        enter image description here



        documentclassarticle
        usepackage[left=1.5cm, right=1.5cm]geometry
        usepackagearray, booktabs

        setlengthextrarowheight1pt
        renewcommandarraystretch1.1
        setlengthtabcolsep4pt

        begindocument

        begintabular@c>bfseriesc r@,/,r r@,/,r r@,/,r r@,/,r r@,/,r r@,/,r r@,/,r@

        &&multicolumn6c&multicolumn8c@textbfSGAN (Ours) \cmidrule(l)9-16
        textbfMetric & textbfDataset & multicolumn2ctextbfLinear&multicolumn2ctextbfLSTM&multicolumn2ctextbfS-LSTM&multicolumn2c1V-1&multicolumn2c1V-20&multicolumn2c20V-20&multicolumn2c@20VP-20 \midrule
        &ETC&0.84&1.33&0.70&1.09&0.73&1.09&0.79&1.13&0.75&1.03&0.61&textbf0.81&textbf0.60&0.87 \
        &HOTEL&textbf0.35&textbf0.39&0.55&0.86&0.49&079&0.71&1.01&0.63&0.90&0.48&0.72&0.52&0.67 \
        ADE&UNIV&0.56&0.82&0.36&0.61&0.41&0.67&0.37&0.60&0.36&0.58&textbf0.36&textbf0.60&0.44&0.76 \
        &ZARA1&0.41&0.62&0.25&0.41&0.27&0.47&0.25&0.42&0.23&0.38&textbf0.21&textbf0.34&0.22&0.35 \
        &ZARA2&0.53&0.77&0.31&0.52&0.33&0.56&0.32&0.52&0.29&0.47&textbf0.27&0.42&0.29&textbf0.42 \midrule
        multicolumn1@ltextbfAVG&&0.54&0.79&0.43&0.70&0.45&0.72&0.49&0.74&0.45&0.67&textbf0.39&textbf0.58&0.41&0.61 \bottomruleaddlinespace[1ex]
        &ETC&1.60&2.94&1.45&2.41&1.48&2.35&1.61&2.21&1.52&2.02&1.22&textbf1.52&textbf1.19&1.62 \
        &HOTEL&textbf0.60&textbf0.72&1.17&.1.91&1.01&1.76&1.44&2.18&1.32&1.97&0.95&1.61&1.02&1.37 \
        FDE&UNIV&1.01&1.59&0.77&1.31&0.84&1.40&0.75&1.28&textbf0.73&textbf1.22&0.75&1.26&0.84&1.52 \
        &ZARA1&0.74&1.21&0.53&0.88&0.56&1.00&0.53&0.91&0.48&0.84&textbf0.42&0.69&0.43&textbf0.68 \
        &ZARA2&0.95&1.48&0.65&1.11&0.70&1.17&0.66&1.11&0.61&1.01&textbf0.54&textbf0.84&0.58&0.84 \midrule
        multicolumn1@ltextbfAVG&&0.98&1.59&0.91&1.52&0.91&1.54&1.00&1.54&0.93&1.41&textbf0.78&textbf1.18&0.81&1.21 \bottomrule

        endtabular
        enddocument





        share|improve this answer















        Here is your tabular typeset approximately how I would have done in my documents. However, I would prefer small capital letters and italic instead of bold to emphasise headings and numbers. I increased the margins so the tabular fits between the margin.



        In the preamble, I have used three commands to change the tabular's spacing:



        setlengthextrarowheight1pt
        renewcommandarraystretch1.1
        setlengthtabcolsep4pt


        The first moves the cell content a little bit down. The second increases the spacining between rows (creates some air). And the third decrease the spacing between columns.



        I have removed all vertical rules and used heavier rules and added space instead of double rules, all according to recommendation in the booktabs manual. That package is used to typeset all rules, so you have suitable distance between rules and cell content. I have also use the array package to have more flexible commands.



        NB! The booktabs manual is a must read if you want to typeset nice tabulars.



        As you also will see, I use two right align column to typeset the number. Since all cells have the same number of decimals, you can use simple r-columns in combination with a array-trick to typeset 1.21 / 2.35. To typeset slash between the two columns of numbers, I use `r@,/,r, which removes all space between the two columns and replace it with small two tiny spaces and the slash.



        In the heading I have moved together two columns using multicolumn.



        enter image description here



        documentclassarticle
        usepackage[left=1.5cm, right=1.5cm]geometry
        usepackagearray, booktabs

        setlengthextrarowheight1pt
        renewcommandarraystretch1.1
        setlengthtabcolsep4pt

        begindocument

        begintabular@c>bfseriesc r@,/,r r@,/,r r@,/,r r@,/,r r@,/,r r@,/,r r@,/,r@

        &&multicolumn6c&multicolumn8c@textbfSGAN (Ours) \cmidrule(l)9-16
        textbfMetric & textbfDataset & multicolumn2ctextbfLinear&multicolumn2ctextbfLSTM&multicolumn2ctextbfS-LSTM&multicolumn2c1V-1&multicolumn2c1V-20&multicolumn2c20V-20&multicolumn2c@20VP-20 \midrule
        &ETC&0.84&1.33&0.70&1.09&0.73&1.09&0.79&1.13&0.75&1.03&0.61&textbf0.81&textbf0.60&0.87 \
        &HOTEL&textbf0.35&textbf0.39&0.55&0.86&0.49&079&0.71&1.01&0.63&0.90&0.48&0.72&0.52&0.67 \
        ADE&UNIV&0.56&0.82&0.36&0.61&0.41&0.67&0.37&0.60&0.36&0.58&textbf0.36&textbf0.60&0.44&0.76 \
        &ZARA1&0.41&0.62&0.25&0.41&0.27&0.47&0.25&0.42&0.23&0.38&textbf0.21&textbf0.34&0.22&0.35 \
        &ZARA2&0.53&0.77&0.31&0.52&0.33&0.56&0.32&0.52&0.29&0.47&textbf0.27&0.42&0.29&textbf0.42 \midrule
        multicolumn1@ltextbfAVG&&0.54&0.79&0.43&0.70&0.45&0.72&0.49&0.74&0.45&0.67&textbf0.39&textbf0.58&0.41&0.61 \bottomruleaddlinespace[1ex]
        &ETC&1.60&2.94&1.45&2.41&1.48&2.35&1.61&2.21&1.52&2.02&1.22&textbf1.52&textbf1.19&1.62 \
        &HOTEL&textbf0.60&textbf0.72&1.17&.1.91&1.01&1.76&1.44&2.18&1.32&1.97&0.95&1.61&1.02&1.37 \
        FDE&UNIV&1.01&1.59&0.77&1.31&0.84&1.40&0.75&1.28&textbf0.73&textbf1.22&0.75&1.26&0.84&1.52 \
        &ZARA1&0.74&1.21&0.53&0.88&0.56&1.00&0.53&0.91&0.48&0.84&textbf0.42&0.69&0.43&textbf0.68 \
        &ZARA2&0.95&1.48&0.65&1.11&0.70&1.17&0.66&1.11&0.61&1.01&textbf0.54&textbf0.84&0.58&0.84 \midrule
        multicolumn1@ltextbfAVG&&0.98&1.59&0.91&1.52&0.91&1.54&1.00&1.54&0.93&1.41&textbf0.78&textbf1.18&0.81&1.21 \bottomrule

        endtabular
        enddocument






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 1 hour ago

























        answered 2 hours ago









        SveinungSveinung

        12.7k2 gold badges33 silver badges60 bronze badges




        12.7k2 gold badges33 silver badges60 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%2f500838%2fhow-to-create-complicated-tables-multiple-nested-columns-and-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

            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

            François Viète Contents Biography Work and thought Bibliography See also Notes Further reading External links Navigation menup. 21Google Bookspp. 75–77Google BooksDe thou (from University of Saint Andrews)ArchivedGoogle BooksGoogle BooksGoogle BooksGoogle booksGoogle Bookscc-parthenay.frL'histoire universelle (fr)Universal History (en)ArchivedAdsabs.harvard.eduPagesperso-orange.frArchive.orgChikara Sasaki. Descartes' mathematical thought p.259Google BooksGoogle BooksGoogle Bookspp. 152 and onwardGoogle BooksGoogle BooksScribd.comGoogle Books1257-7979Google BooksGoogle BooksGoogle BooksGoogle BooksGoogle BooksGoogle BooksGallica.bnf.frGoogle BooksGoogle Books"François Viète"Francois Viète: Father of Modern Algebraic NotationThe Lawyer and the GamblerAbout TarporleySite de Jean-Paul GuichardL'algèbre nouvelle"About the Harmonicon"cb120511976(data)1188044800000 0001 0913 5903n82164680ola2013766880073431702w6vt1sb70287374827140948071409480