Table Formatting SuggestionHow to get multiple multirows in a table?Add extra space only between two specific columns of a tabular without adding extra columnsFormatting table issuestabu package - gaps in vertical linesWhat options are there to globally format tables also allowing local overrides?Declaring array of integersCline multi-page tableCreate environment that allows writing multi-page table content down the column rather than across the rowHow to set longtable width to text width so that the text in cell wraps around automatically?Tabular with rounded corners made with tikzpicture with overlay is not properly positioned inside table environment
What type of logical fallacy is the offering of a source which is really long and not specifying what part of the source is relevant?
Giving a talk on a different topic than what we discussed
How to control LWC styling dynamically?
how to make a twisted wrapper
Decision problems for which it is unknown whether they are decidable
Which skill would I use for ventriloquism?
Rashi's explanation of why we are told that Avram was 86 at the birth of Yishma'el
What do you call someone whose unmarried partner has died?
What's an "add" chord?
Basic Accidental Question
"Cобака на сене" - is this expression still in use or is it dated?
Surfacing out of a sunken ship/submarine - Survival Tips
How to get the address of a C++ lambda function within the lambda itself
Canonical reference for Chern characteristic classes
Is it possible to ask for reference in in an open source project?
Creating vector (with lines/polygons) from raster based on paper map in QGIS
What do you mean by particle can be in two places at once?
'Nuke the sky' to make a rocket launch a tiny bit easier
What on earth is this small wall-mounted computer?
Google just EOLed the original Pixel. How long until it's a brick?
What are these criss-cross patterns close to Cambridge Airport (UK)?
How much money is needed to prove you can support yourself with ESTA
Find constant that allows an integral to be finite
An historical mystery : Poincaré’s silence on Lebesgue integral and measure theory?
Table Formatting Suggestion
How to get multiple multirows in a table?Add extra space only between two specific columns of a tabular without adding extra columnsFormatting table issuestabu package - gaps in vertical linesWhat options are there to globally format tables also allowing local overrides?Declaring array of integersCline multi-page tableCreate environment that allows writing multi-page table content down the column rather than across the rowHow to set longtable width to text width so that the text in cell wraps around automatically?Tabular with rounded corners made with tikzpicture with overlay is not properly positioned inside table environment
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
This is more of an open-ended, personal opinion type question. I am trying to make a nice-looking table for a report. Here is what I have so far:
The contents of each are slightly different, but the formats are identical: 8 rows and 10 columns. The first column explains some of the variables being measured. After that, for the next nine columns, the columns are grouped depending on the clustering we used, 3 columns for each method.
Perks and drawbacks for the first table:
- (+) The vertical dividing lines sort of separate each of the blocks of the table.
- (-) The top-left part of the table looks absolutely disgusting, and it is weird that the list of variables is just surrounded by a box like that.
Perks and drawbacks for the second table:
- (-) Because there are no vertical lines, it may be harder to tell the block structure of the table.
- (+) Seems much more visually appealing than the first. I am not crazy about the empty space in the top left, but there is not much you can do about that, and it is not nearly as bad as the first table.
I also read somewhere that in papers and reports, vertical lines should never ever be used in tables. So the second table has that rule of thumb going for it as well.
Are there any tips/protocols that one should use when constructing tables of this nature? I should note that I used the pdflscape
package to make the tables in a landscape format since I would like to fit them on one page.
Here is the code for the tables, sorry if it is a mess:
documentclassarticle
usepackagemultirow
usepackagepdflscape
begindocument
beginlandscape
sectionTables
begintable[ht]
centering
defarraystretch1.5
begintabular cline2-10
multicolumn1c & multicolumn3cNo Clustering & multicolumn3c$K$-means Clustering & multicolumn3cHierarchical Clustering \
multicolumn1c & multicolumn3c-- & multicolumn3c$K=2$ & multicolumn3c$K=7$ \ cline2-10
multicolumn1c & Lasso & Elastic Net & pcLasso & gLasso & sgLasso & pcLasso & gLasso & sgLasso & pcLasso \ hline
multirow2*Tuning Parameters & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ \
& -- & $alpha = 0.2$ & $textttrat = 0.95$ & -- & $alpha = $ & $textttrat = 0.95$ & -- & $alpha = $ & $textttrat = 0.95$ \
Misclassifications & $6/31$ & $5/31$ & $5/31$ & $5/31$ & $/31$ & $4/31$ & $5/31$ & $/31$ & $3/31$ \
Non-zero Coefficients & $16$ & $63$ & $30$ & $1909$ & & $13$ & $687$ & & $7$ \
Non-zero Groups & -- & -- & -- & $1$ & & & $1$ & & \ hline
endtabular
captionThe performance of various models on the colon data set.
labelcolontable
vspace0.45cm % max is 0.49cm, 0.5cm causes page break
begintabularcccccccccc hline
& multicolumn3cNo Clustering & multicolumn3c$K$-means Clustering & multicolumn3cHierarchical Clustering \
& multicolumn3c-- & multicolumn3c$K=2$ & multicolumn3c$K=5$ \ hline
& Lasso & Elastic Net & pcLasso & gLasso & sgLasso & pcLasso & gLasso & sgLasso & pcLasso \ hline
multirow2*Tuning Parameters & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ \
& -- & $alpha = 0.8$ & $textttrat = 0.95$ & -- & $alpha = $ & $textttrat = 0.95$ & -- & $alpha = $ & $textttrat = 0.95$ \
Misclassifications & $5/36$ & $3/36$ & $3/36$ & $5/36$ & $/36$ & $2/36$ & $4/36$ & $/36$ & $2/36$ \
Non-zero Coefficients & $14$ & $28$ & $41$ & $7129$ & & $62$ & $2714$ & & $46$ \
Non-zero Groups & -- & -- & -- & $2$ & & & $2$ & & \ hline
endtabular
captionThe performance of various models on the leukemia data set.
labelleuktable
endtable
endlandscape
enddocument
tables formatting
add a comment
|
This is more of an open-ended, personal opinion type question. I am trying to make a nice-looking table for a report. Here is what I have so far:
The contents of each are slightly different, but the formats are identical: 8 rows and 10 columns. The first column explains some of the variables being measured. After that, for the next nine columns, the columns are grouped depending on the clustering we used, 3 columns for each method.
Perks and drawbacks for the first table:
- (+) The vertical dividing lines sort of separate each of the blocks of the table.
- (-) The top-left part of the table looks absolutely disgusting, and it is weird that the list of variables is just surrounded by a box like that.
Perks and drawbacks for the second table:
- (-) Because there are no vertical lines, it may be harder to tell the block structure of the table.
- (+) Seems much more visually appealing than the first. I am not crazy about the empty space in the top left, but there is not much you can do about that, and it is not nearly as bad as the first table.
I also read somewhere that in papers and reports, vertical lines should never ever be used in tables. So the second table has that rule of thumb going for it as well.
Are there any tips/protocols that one should use when constructing tables of this nature? I should note that I used the pdflscape
package to make the tables in a landscape format since I would like to fit them on one page.
Here is the code for the tables, sorry if it is a mess:
documentclassarticle
usepackagemultirow
usepackagepdflscape
begindocument
beginlandscape
sectionTables
begintable[ht]
centering
defarraystretch1.5
begintabular cline2-10
multicolumn1c & multicolumn3cNo Clustering & multicolumn3c$K$-means Clustering & multicolumn3cHierarchical Clustering \
multicolumn1c & multicolumn3c-- & multicolumn3c$K=2$ & multicolumn3c$K=7$ \ cline2-10
multicolumn1c & Lasso & Elastic Net & pcLasso & gLasso & sgLasso & pcLasso & gLasso & sgLasso & pcLasso \ hline
multirow2*Tuning Parameters & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ \
& -- & $alpha = 0.2$ & $textttrat = 0.95$ & -- & $alpha = $ & $textttrat = 0.95$ & -- & $alpha = $ & $textttrat = 0.95$ \
Misclassifications & $6/31$ & $5/31$ & $5/31$ & $5/31$ & $/31$ & $4/31$ & $5/31$ & $/31$ & $3/31$ \
Non-zero Coefficients & $16$ & $63$ & $30$ & $1909$ & & $13$ & $687$ & & $7$ \
Non-zero Groups & -- & -- & -- & $1$ & & & $1$ & & \ hline
endtabular
captionThe performance of various models on the colon data set.
labelcolontable
vspace0.45cm % max is 0.49cm, 0.5cm causes page break
begintabularcccccccccc hline
& multicolumn3cNo Clustering & multicolumn3c$K$-means Clustering & multicolumn3cHierarchical Clustering \
& multicolumn3c-- & multicolumn3c$K=2$ & multicolumn3c$K=5$ \ hline
& Lasso & Elastic Net & pcLasso & gLasso & sgLasso & pcLasso & gLasso & sgLasso & pcLasso \ hline
multirow2*Tuning Parameters & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ \
& -- & $alpha = 0.8$ & $textttrat = 0.95$ & -- & $alpha = $ & $textttrat = 0.95$ & -- & $alpha = $ & $textttrat = 0.95$ \
Misclassifications & $5/36$ & $3/36$ & $3/36$ & $5/36$ & $/36$ & $2/36$ & $4/36$ & $/36$ & $2/36$ \
Non-zero Coefficients & $14$ & $28$ & $41$ & $7129$ & & $62$ & $2714$ & & $46$ \
Non-zero Groups & -- & -- & -- & $2$ & & & $2$ & & \ hline
endtabular
captionThe performance of various models on the leukemia data set.
labelleuktable
endtable
endlandscape
enddocument
tables formatting
Have a look at booktabs doc. This a package devoted to improve the visual aspect of tables. This is done with different interline rules of different weights (and no vertical lines) and it largely improve tables, IMHO.
– Alain Merigot
Jul 20 at 21:54
add a comment
|
This is more of an open-ended, personal opinion type question. I am trying to make a nice-looking table for a report. Here is what I have so far:
The contents of each are slightly different, but the formats are identical: 8 rows and 10 columns. The first column explains some of the variables being measured. After that, for the next nine columns, the columns are grouped depending on the clustering we used, 3 columns for each method.
Perks and drawbacks for the first table:
- (+) The vertical dividing lines sort of separate each of the blocks of the table.
- (-) The top-left part of the table looks absolutely disgusting, and it is weird that the list of variables is just surrounded by a box like that.
Perks and drawbacks for the second table:
- (-) Because there are no vertical lines, it may be harder to tell the block structure of the table.
- (+) Seems much more visually appealing than the first. I am not crazy about the empty space in the top left, but there is not much you can do about that, and it is not nearly as bad as the first table.
I also read somewhere that in papers and reports, vertical lines should never ever be used in tables. So the second table has that rule of thumb going for it as well.
Are there any tips/protocols that one should use when constructing tables of this nature? I should note that I used the pdflscape
package to make the tables in a landscape format since I would like to fit them on one page.
Here is the code for the tables, sorry if it is a mess:
documentclassarticle
usepackagemultirow
usepackagepdflscape
begindocument
beginlandscape
sectionTables
begintable[ht]
centering
defarraystretch1.5
begintabular cline2-10
multicolumn1c & multicolumn3cNo Clustering & multicolumn3c$K$-means Clustering & multicolumn3cHierarchical Clustering \
multicolumn1c & multicolumn3c-- & multicolumn3c$K=2$ & multicolumn3c$K=7$ \ cline2-10
multicolumn1c & Lasso & Elastic Net & pcLasso & gLasso & sgLasso & pcLasso & gLasso & sgLasso & pcLasso \ hline
multirow2*Tuning Parameters & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ \
& -- & $alpha = 0.2$ & $textttrat = 0.95$ & -- & $alpha = $ & $textttrat = 0.95$ & -- & $alpha = $ & $textttrat = 0.95$ \
Misclassifications & $6/31$ & $5/31$ & $5/31$ & $5/31$ & $/31$ & $4/31$ & $5/31$ & $/31$ & $3/31$ \
Non-zero Coefficients & $16$ & $63$ & $30$ & $1909$ & & $13$ & $687$ & & $7$ \
Non-zero Groups & -- & -- & -- & $1$ & & & $1$ & & \ hline
endtabular
captionThe performance of various models on the colon data set.
labelcolontable
vspace0.45cm % max is 0.49cm, 0.5cm causes page break
begintabularcccccccccc hline
& multicolumn3cNo Clustering & multicolumn3c$K$-means Clustering & multicolumn3cHierarchical Clustering \
& multicolumn3c-- & multicolumn3c$K=2$ & multicolumn3c$K=5$ \ hline
& Lasso & Elastic Net & pcLasso & gLasso & sgLasso & pcLasso & gLasso & sgLasso & pcLasso \ hline
multirow2*Tuning Parameters & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ \
& -- & $alpha = 0.8$ & $textttrat = 0.95$ & -- & $alpha = $ & $textttrat = 0.95$ & -- & $alpha = $ & $textttrat = 0.95$ \
Misclassifications & $5/36$ & $3/36$ & $3/36$ & $5/36$ & $/36$ & $2/36$ & $4/36$ & $/36$ & $2/36$ \
Non-zero Coefficients & $14$ & $28$ & $41$ & $7129$ & & $62$ & $2714$ & & $46$ \
Non-zero Groups & -- & -- & -- & $2$ & & & $2$ & & \ hline
endtabular
captionThe performance of various models on the leukemia data set.
labelleuktable
endtable
endlandscape
enddocument
tables formatting
This is more of an open-ended, personal opinion type question. I am trying to make a nice-looking table for a report. Here is what I have so far:
The contents of each are slightly different, but the formats are identical: 8 rows and 10 columns. The first column explains some of the variables being measured. After that, for the next nine columns, the columns are grouped depending on the clustering we used, 3 columns for each method.
Perks and drawbacks for the first table:
- (+) The vertical dividing lines sort of separate each of the blocks of the table.
- (-) The top-left part of the table looks absolutely disgusting, and it is weird that the list of variables is just surrounded by a box like that.
Perks and drawbacks for the second table:
- (-) Because there are no vertical lines, it may be harder to tell the block structure of the table.
- (+) Seems much more visually appealing than the first. I am not crazy about the empty space in the top left, but there is not much you can do about that, and it is not nearly as bad as the first table.
I also read somewhere that in papers and reports, vertical lines should never ever be used in tables. So the second table has that rule of thumb going for it as well.
Are there any tips/protocols that one should use when constructing tables of this nature? I should note that I used the pdflscape
package to make the tables in a landscape format since I would like to fit them on one page.
Here is the code for the tables, sorry if it is a mess:
documentclassarticle
usepackagemultirow
usepackagepdflscape
begindocument
beginlandscape
sectionTables
begintable[ht]
centering
defarraystretch1.5
begintabular cline2-10
multicolumn1c & multicolumn3cNo Clustering & multicolumn3c$K$-means Clustering & multicolumn3cHierarchical Clustering \
multicolumn1c & multicolumn3c-- & multicolumn3c$K=2$ & multicolumn3c$K=7$ \ cline2-10
multicolumn1c & Lasso & Elastic Net & pcLasso & gLasso & sgLasso & pcLasso & gLasso & sgLasso & pcLasso \ hline
multirow2*Tuning Parameters & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ \
& -- & $alpha = 0.2$ & $textttrat = 0.95$ & -- & $alpha = $ & $textttrat = 0.95$ & -- & $alpha = $ & $textttrat = 0.95$ \
Misclassifications & $6/31$ & $5/31$ & $5/31$ & $5/31$ & $/31$ & $4/31$ & $5/31$ & $/31$ & $3/31$ \
Non-zero Coefficients & $16$ & $63$ & $30$ & $1909$ & & $13$ & $687$ & & $7$ \
Non-zero Groups & -- & -- & -- & $1$ & & & $1$ & & \ hline
endtabular
captionThe performance of various models on the colon data set.
labelcolontable
vspace0.45cm % max is 0.49cm, 0.5cm causes page break
begintabularcccccccccc hline
& multicolumn3cNo Clustering & multicolumn3c$K$-means Clustering & multicolumn3cHierarchical Clustering \
& multicolumn3c-- & multicolumn3c$K=2$ & multicolumn3c$K=5$ \ hline
& Lasso & Elastic Net & pcLasso & gLasso & sgLasso & pcLasso & gLasso & sgLasso & pcLasso \ hline
multirow2*Tuning Parameters & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ \
& -- & $alpha = 0.8$ & $textttrat = 0.95$ & -- & $alpha = $ & $textttrat = 0.95$ & -- & $alpha = $ & $textttrat = 0.95$ \
Misclassifications & $5/36$ & $3/36$ & $3/36$ & $5/36$ & $/36$ & $2/36$ & $4/36$ & $/36$ & $2/36$ \
Non-zero Coefficients & $14$ & $28$ & $41$ & $7129$ & & $62$ & $2714$ & & $46$ \
Non-zero Groups & -- & -- & -- & $2$ & & & $2$ & & \ hline
endtabular
captionThe performance of various models on the leukemia data set.
labelleuktable
endtable
endlandscape
enddocument
tables formatting
tables formatting
asked Jul 20 at 21:31
Aiden KennyAiden Kenny
6601 silver badge7 bronze badges
6601 silver badge7 bronze badges
Have a look at booktabs doc. This a package devoted to improve the visual aspect of tables. This is done with different interline rules of different weights (and no vertical lines) and it largely improve tables, IMHO.
– Alain Merigot
Jul 20 at 21:54
add a comment
|
Have a look at booktabs doc. This a package devoted to improve the visual aspect of tables. This is done with different interline rules of different weights (and no vertical lines) and it largely improve tables, IMHO.
– Alain Merigot
Jul 20 at 21:54
Have a look at booktabs doc. This a package devoted to improve the visual aspect of tables. This is done with different interline rules of different weights (and no vertical lines) and it largely improve tables, IMHO.
– Alain Merigot
Jul 20 at 21:54
Have a look at booktabs doc. This a package devoted to improve the visual aspect of tables. This is done with different interline rules of different weights (and no vertical lines) and it largely improve tables, IMHO.
– Alain Merigot
Jul 20 at 21:54
add a comment
|
2 Answers
2
active
oldest
votes
I'd recommend the usage of the booktabs package especially the use of its cmidrule
command with which you can easily overcome the drawback that you listed for your second table. I have also used the tabularx package that might come in handy, if the contents of your first column get longer than they currently are as the X
type column allows for automated line breaks and ensures that the whole table is exactly as wide as the specified length (linewidth
in case of the following MWE):
documentclassarticle
usepackagemultirow
usepackagepdflscape
usepackagebooktabs
usepackagetabularx
begindocument
beginlandscape
sectionTables
begintable[ht]
begintabularxlinewidthXccccccccc toprule
& multicolumn3cNo Clustering & multicolumn3c$K$-means Clustering & multicolumn3cHierarchical Clustering \
& multicolumn3c-- & multicolumn3c$K=2$ & multicolumn3c$K=5$ \
cmidrule(r)2-4 cmidrule(lr)5-7 cmidrule(l)8-10
& Lasso & Elastic Net & pcLasso & gLasso & sgLasso & pcLasso & gLasso & sgLasso & pcLasso \ midrule
Tuning Parameters & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ \
& -- & $alpha = 0.8$ & $textttrat = 0.95$ & -- & $alpha = $ & $textttrat = 0.95$ & -- & $alpha = $ & $textttrat = 0.95$ \ addlinespace
Misclassifications & $5/36$ & $3/36$ & $3/36$ & $5/36$ & $/36$ & $2/36$ & $4/36$ & $/36$ & $2/36$ \
Non-zero Coefficients & $14$ & $28$ & $41$ & $7129$ & & $62$ & $2714$ & & $46$ \
Non-zero Groups & -- & -- & -- & $2$ & & & $2$ & & \ bottomrule
endtabularx
captionThe performance of various models on the leukemia data set.
labelleuktable
endtable
endlandscape
enddocument
Accepted answer because it is very easy to use. I should note, though, that on my document I had to use0.7865linewidth
instead oflinewidth
by default since otherwise, the lines of the table extended way past the last column.
– Aiden Kenny
Jul 20 at 23:28
add a comment
|
How about this layout? I've put the caption above the table, which is the typographic traditional position, for obvious reasons. The booktabs
package defines horizontal rules with variable thickness and some vertical padding above and below. Furthermore, the cmidrule
s can help visualise the groups of columns, using their optional trimming arguments l
and r
:
documentclassarticle
usepackagemultirow
usepackagebooktabs, caption
usepackage[usestackEOL]stackengine
usepackagepdflscape
begindocument
beginlandscape
sectionTables
begintable[ht]
centering
defarraystretch1.5
setlengthcmidrulewidthlightrulewidth
setlengthtabcolsep4pt
captionThe performance of various models on the leukemia data set.
labelleuktable
begintabular@,lccc@qquadccc@qquadccc@,%
& multicolumn3cshortstackNo Clustering\ --hspace*2.5em & multicolumn3cshortstack$K$-means Clustering \ $K = 2$hspace*2.5em & multicolumn3cshortstackHierarchical Clustering\$K = 5$hspace*0.5em \
cmidrule(r2.5em)2-4 cmidrule(r2.5em)5-7 cmidrule(r0.5em)8-10
& Lasso & Elastic Net & pcLasso & gLasso & sgLasso & pcLasso & gLasso & sgLasso & pcLasso \ midrule
multirow1.75*Tuning Parameters & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ \[-1.5ex]
& -- & $alpha = 0.8$ & $textttrat = 0.95$ & -- & $alpha = $ & $textttrat = 0.95$ & -- & $alpha = $ & $textttrat = 0.95$ \
addlinespace[0.5ex]
Misclassifications & $5/36$ & $3/36$ & $3/36$ & $5/36$ & $/36$ & $2/36$ & $4/36$ & $/36$ & $2/36$ \
addlinespace[0.5ex]
Non-zero Coefficients & $14$ & $28$ & $41$ & $7129$ & & $62$ & $2714$ & & $46$ \
addlinespace[0.5ex]
Non-zero Groups & -- & -- & -- & $2$ & & & $2$ & & \ bottomrule
endtabular
endtable
endlandscape
enddocument
Just curious, what makes you say putting the caption above the table is the "typographic traditional position"? From all of the papers I have read for this project, all captions have been below the table.
– Aiden Kenny
Jul 20 at 23:29
That is because if a table does not not fit on a single page, the reader usually doesn't want to have to turn pages to see what the table is about. . Of course, I was speaking of the times of manual typography. . You also may note that the floatrow package uses a similar syntax for rows of tables and rows of figures, but automatically places table captions above and figure captions below the float.
– Bernard
Jul 20 at 23:36
add a comment
|
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/4.0/"u003ecc by-sa 4.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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f500789%2ftable-formatting-suggestion%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
I'd recommend the usage of the booktabs package especially the use of its cmidrule
command with which you can easily overcome the drawback that you listed for your second table. I have also used the tabularx package that might come in handy, if the contents of your first column get longer than they currently are as the X
type column allows for automated line breaks and ensures that the whole table is exactly as wide as the specified length (linewidth
in case of the following MWE):
documentclassarticle
usepackagemultirow
usepackagepdflscape
usepackagebooktabs
usepackagetabularx
begindocument
beginlandscape
sectionTables
begintable[ht]
begintabularxlinewidthXccccccccc toprule
& multicolumn3cNo Clustering & multicolumn3c$K$-means Clustering & multicolumn3cHierarchical Clustering \
& multicolumn3c-- & multicolumn3c$K=2$ & multicolumn3c$K=5$ \
cmidrule(r)2-4 cmidrule(lr)5-7 cmidrule(l)8-10
& Lasso & Elastic Net & pcLasso & gLasso & sgLasso & pcLasso & gLasso & sgLasso & pcLasso \ midrule
Tuning Parameters & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ \
& -- & $alpha = 0.8$ & $textttrat = 0.95$ & -- & $alpha = $ & $textttrat = 0.95$ & -- & $alpha = $ & $textttrat = 0.95$ \ addlinespace
Misclassifications & $5/36$ & $3/36$ & $3/36$ & $5/36$ & $/36$ & $2/36$ & $4/36$ & $/36$ & $2/36$ \
Non-zero Coefficients & $14$ & $28$ & $41$ & $7129$ & & $62$ & $2714$ & & $46$ \
Non-zero Groups & -- & -- & -- & $2$ & & & $2$ & & \ bottomrule
endtabularx
captionThe performance of various models on the leukemia data set.
labelleuktable
endtable
endlandscape
enddocument
Accepted answer because it is very easy to use. I should note, though, that on my document I had to use0.7865linewidth
instead oflinewidth
by default since otherwise, the lines of the table extended way past the last column.
– Aiden Kenny
Jul 20 at 23:28
add a comment
|
I'd recommend the usage of the booktabs package especially the use of its cmidrule
command with which you can easily overcome the drawback that you listed for your second table. I have also used the tabularx package that might come in handy, if the contents of your first column get longer than they currently are as the X
type column allows for automated line breaks and ensures that the whole table is exactly as wide as the specified length (linewidth
in case of the following MWE):
documentclassarticle
usepackagemultirow
usepackagepdflscape
usepackagebooktabs
usepackagetabularx
begindocument
beginlandscape
sectionTables
begintable[ht]
begintabularxlinewidthXccccccccc toprule
& multicolumn3cNo Clustering & multicolumn3c$K$-means Clustering & multicolumn3cHierarchical Clustering \
& multicolumn3c-- & multicolumn3c$K=2$ & multicolumn3c$K=5$ \
cmidrule(r)2-4 cmidrule(lr)5-7 cmidrule(l)8-10
& Lasso & Elastic Net & pcLasso & gLasso & sgLasso & pcLasso & gLasso & sgLasso & pcLasso \ midrule
Tuning Parameters & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ \
& -- & $alpha = 0.8$ & $textttrat = 0.95$ & -- & $alpha = $ & $textttrat = 0.95$ & -- & $alpha = $ & $textttrat = 0.95$ \ addlinespace
Misclassifications & $5/36$ & $3/36$ & $3/36$ & $5/36$ & $/36$ & $2/36$ & $4/36$ & $/36$ & $2/36$ \
Non-zero Coefficients & $14$ & $28$ & $41$ & $7129$ & & $62$ & $2714$ & & $46$ \
Non-zero Groups & -- & -- & -- & $2$ & & & $2$ & & \ bottomrule
endtabularx
captionThe performance of various models on the leukemia data set.
labelleuktable
endtable
endlandscape
enddocument
Accepted answer because it is very easy to use. I should note, though, that on my document I had to use0.7865linewidth
instead oflinewidth
by default since otherwise, the lines of the table extended way past the last column.
– Aiden Kenny
Jul 20 at 23:28
add a comment
|
I'd recommend the usage of the booktabs package especially the use of its cmidrule
command with which you can easily overcome the drawback that you listed for your second table. I have also used the tabularx package that might come in handy, if the contents of your first column get longer than they currently are as the X
type column allows for automated line breaks and ensures that the whole table is exactly as wide as the specified length (linewidth
in case of the following MWE):
documentclassarticle
usepackagemultirow
usepackagepdflscape
usepackagebooktabs
usepackagetabularx
begindocument
beginlandscape
sectionTables
begintable[ht]
begintabularxlinewidthXccccccccc toprule
& multicolumn3cNo Clustering & multicolumn3c$K$-means Clustering & multicolumn3cHierarchical Clustering \
& multicolumn3c-- & multicolumn3c$K=2$ & multicolumn3c$K=5$ \
cmidrule(r)2-4 cmidrule(lr)5-7 cmidrule(l)8-10
& Lasso & Elastic Net & pcLasso & gLasso & sgLasso & pcLasso & gLasso & sgLasso & pcLasso \ midrule
Tuning Parameters & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ \
& -- & $alpha = 0.8$ & $textttrat = 0.95$ & -- & $alpha = $ & $textttrat = 0.95$ & -- & $alpha = $ & $textttrat = 0.95$ \ addlinespace
Misclassifications & $5/36$ & $3/36$ & $3/36$ & $5/36$ & $/36$ & $2/36$ & $4/36$ & $/36$ & $2/36$ \
Non-zero Coefficients & $14$ & $28$ & $41$ & $7129$ & & $62$ & $2714$ & & $46$ \
Non-zero Groups & -- & -- & -- & $2$ & & & $2$ & & \ bottomrule
endtabularx
captionThe performance of various models on the leukemia data set.
labelleuktable
endtable
endlandscape
enddocument
I'd recommend the usage of the booktabs package especially the use of its cmidrule
command with which you can easily overcome the drawback that you listed for your second table. I have also used the tabularx package that might come in handy, if the contents of your first column get longer than they currently are as the X
type column allows for automated line breaks and ensures that the whole table is exactly as wide as the specified length (linewidth
in case of the following MWE):
documentclassarticle
usepackagemultirow
usepackagepdflscape
usepackagebooktabs
usepackagetabularx
begindocument
beginlandscape
sectionTables
begintable[ht]
begintabularxlinewidthXccccccccc toprule
& multicolumn3cNo Clustering & multicolumn3c$K$-means Clustering & multicolumn3cHierarchical Clustering \
& multicolumn3c-- & multicolumn3c$K=2$ & multicolumn3c$K=5$ \
cmidrule(r)2-4 cmidrule(lr)5-7 cmidrule(l)8-10
& Lasso & Elastic Net & pcLasso & gLasso & sgLasso & pcLasso & gLasso & sgLasso & pcLasso \ midrule
Tuning Parameters & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ \
& -- & $alpha = 0.8$ & $textttrat = 0.95$ & -- & $alpha = $ & $textttrat = 0.95$ & -- & $alpha = $ & $textttrat = 0.95$ \ addlinespace
Misclassifications & $5/36$ & $3/36$ & $3/36$ & $5/36$ & $/36$ & $2/36$ & $4/36$ & $/36$ & $2/36$ \
Non-zero Coefficients & $14$ & $28$ & $41$ & $7129$ & & $62$ & $2714$ & & $46$ \
Non-zero Groups & -- & -- & -- & $2$ & & & $2$ & & \ bottomrule
endtabularx
captionThe performance of various models on the leukemia data set.
labelleuktable
endtable
endlandscape
enddocument
edited Jul 20 at 23:00
Sveinung
15.4k2 gold badges39 silver badges64 bronze badges
15.4k2 gold badges39 silver badges64 bronze badges
answered Jul 20 at 21:59
leandriisleandriis
22.5k1 gold badge12 silver badges41 bronze badges
22.5k1 gold badge12 silver badges41 bronze badges
Accepted answer because it is very easy to use. I should note, though, that on my document I had to use0.7865linewidth
instead oflinewidth
by default since otherwise, the lines of the table extended way past the last column.
– Aiden Kenny
Jul 20 at 23:28
add a comment
|
Accepted answer because it is very easy to use. I should note, though, that on my document I had to use0.7865linewidth
instead oflinewidth
by default since otherwise, the lines of the table extended way past the last column.
– Aiden Kenny
Jul 20 at 23:28
Accepted answer because it is very easy to use. I should note, though, that on my document I had to use
0.7865linewidth
instead of linewidth
by default since otherwise, the lines of the table extended way past the last column.– Aiden Kenny
Jul 20 at 23:28
Accepted answer because it is very easy to use. I should note, though, that on my document I had to use
0.7865linewidth
instead of linewidth
by default since otherwise, the lines of the table extended way past the last column.– Aiden Kenny
Jul 20 at 23:28
add a comment
|
How about this layout? I've put the caption above the table, which is the typographic traditional position, for obvious reasons. The booktabs
package defines horizontal rules with variable thickness and some vertical padding above and below. Furthermore, the cmidrule
s can help visualise the groups of columns, using their optional trimming arguments l
and r
:
documentclassarticle
usepackagemultirow
usepackagebooktabs, caption
usepackage[usestackEOL]stackengine
usepackagepdflscape
begindocument
beginlandscape
sectionTables
begintable[ht]
centering
defarraystretch1.5
setlengthcmidrulewidthlightrulewidth
setlengthtabcolsep4pt
captionThe performance of various models on the leukemia data set.
labelleuktable
begintabular@,lccc@qquadccc@qquadccc@,%
& multicolumn3cshortstackNo Clustering\ --hspace*2.5em & multicolumn3cshortstack$K$-means Clustering \ $K = 2$hspace*2.5em & multicolumn3cshortstackHierarchical Clustering\$K = 5$hspace*0.5em \
cmidrule(r2.5em)2-4 cmidrule(r2.5em)5-7 cmidrule(r0.5em)8-10
& Lasso & Elastic Net & pcLasso & gLasso & sgLasso & pcLasso & gLasso & sgLasso & pcLasso \ midrule
multirow1.75*Tuning Parameters & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ \[-1.5ex]
& -- & $alpha = 0.8$ & $textttrat = 0.95$ & -- & $alpha = $ & $textttrat = 0.95$ & -- & $alpha = $ & $textttrat = 0.95$ \
addlinespace[0.5ex]
Misclassifications & $5/36$ & $3/36$ & $3/36$ & $5/36$ & $/36$ & $2/36$ & $4/36$ & $/36$ & $2/36$ \
addlinespace[0.5ex]
Non-zero Coefficients & $14$ & $28$ & $41$ & $7129$ & & $62$ & $2714$ & & $46$ \
addlinespace[0.5ex]
Non-zero Groups & -- & -- & -- & $2$ & & & $2$ & & \ bottomrule
endtabular
endtable
endlandscape
enddocument
Just curious, what makes you say putting the caption above the table is the "typographic traditional position"? From all of the papers I have read for this project, all captions have been below the table.
– Aiden Kenny
Jul 20 at 23:29
That is because if a table does not not fit on a single page, the reader usually doesn't want to have to turn pages to see what the table is about. . Of course, I was speaking of the times of manual typography. . You also may note that the floatrow package uses a similar syntax for rows of tables and rows of figures, but automatically places table captions above and figure captions below the float.
– Bernard
Jul 20 at 23:36
add a comment
|
How about this layout? I've put the caption above the table, which is the typographic traditional position, for obvious reasons. The booktabs
package defines horizontal rules with variable thickness and some vertical padding above and below. Furthermore, the cmidrule
s can help visualise the groups of columns, using their optional trimming arguments l
and r
:
documentclassarticle
usepackagemultirow
usepackagebooktabs, caption
usepackage[usestackEOL]stackengine
usepackagepdflscape
begindocument
beginlandscape
sectionTables
begintable[ht]
centering
defarraystretch1.5
setlengthcmidrulewidthlightrulewidth
setlengthtabcolsep4pt
captionThe performance of various models on the leukemia data set.
labelleuktable
begintabular@,lccc@qquadccc@qquadccc@,%
& multicolumn3cshortstackNo Clustering\ --hspace*2.5em & multicolumn3cshortstack$K$-means Clustering \ $K = 2$hspace*2.5em & multicolumn3cshortstackHierarchical Clustering\$K = 5$hspace*0.5em \
cmidrule(r2.5em)2-4 cmidrule(r2.5em)5-7 cmidrule(r0.5em)8-10
& Lasso & Elastic Net & pcLasso & gLasso & sgLasso & pcLasso & gLasso & sgLasso & pcLasso \ midrule
multirow1.75*Tuning Parameters & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ \[-1.5ex]
& -- & $alpha = 0.8$ & $textttrat = 0.95$ & -- & $alpha = $ & $textttrat = 0.95$ & -- & $alpha = $ & $textttrat = 0.95$ \
addlinespace[0.5ex]
Misclassifications & $5/36$ & $3/36$ & $3/36$ & $5/36$ & $/36$ & $2/36$ & $4/36$ & $/36$ & $2/36$ \
addlinespace[0.5ex]
Non-zero Coefficients & $14$ & $28$ & $41$ & $7129$ & & $62$ & $2714$ & & $46$ \
addlinespace[0.5ex]
Non-zero Groups & -- & -- & -- & $2$ & & & $2$ & & \ bottomrule
endtabular
endtable
endlandscape
enddocument
Just curious, what makes you say putting the caption above the table is the "typographic traditional position"? From all of the papers I have read for this project, all captions have been below the table.
– Aiden Kenny
Jul 20 at 23:29
That is because if a table does not not fit on a single page, the reader usually doesn't want to have to turn pages to see what the table is about. . Of course, I was speaking of the times of manual typography. . You also may note that the floatrow package uses a similar syntax for rows of tables and rows of figures, but automatically places table captions above and figure captions below the float.
– Bernard
Jul 20 at 23:36
add a comment
|
How about this layout? I've put the caption above the table, which is the typographic traditional position, for obvious reasons. The booktabs
package defines horizontal rules with variable thickness and some vertical padding above and below. Furthermore, the cmidrule
s can help visualise the groups of columns, using their optional trimming arguments l
and r
:
documentclassarticle
usepackagemultirow
usepackagebooktabs, caption
usepackage[usestackEOL]stackengine
usepackagepdflscape
begindocument
beginlandscape
sectionTables
begintable[ht]
centering
defarraystretch1.5
setlengthcmidrulewidthlightrulewidth
setlengthtabcolsep4pt
captionThe performance of various models on the leukemia data set.
labelleuktable
begintabular@,lccc@qquadccc@qquadccc@,%
& multicolumn3cshortstackNo Clustering\ --hspace*2.5em & multicolumn3cshortstack$K$-means Clustering \ $K = 2$hspace*2.5em & multicolumn3cshortstackHierarchical Clustering\$K = 5$hspace*0.5em \
cmidrule(r2.5em)2-4 cmidrule(r2.5em)5-7 cmidrule(r0.5em)8-10
& Lasso & Elastic Net & pcLasso & gLasso & sgLasso & pcLasso & gLasso & sgLasso & pcLasso \ midrule
multirow1.75*Tuning Parameters & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ \[-1.5ex]
& -- & $alpha = 0.8$ & $textttrat = 0.95$ & -- & $alpha = $ & $textttrat = 0.95$ & -- & $alpha = $ & $textttrat = 0.95$ \
addlinespace[0.5ex]
Misclassifications & $5/36$ & $3/36$ & $3/36$ & $5/36$ & $/36$ & $2/36$ & $4/36$ & $/36$ & $2/36$ \
addlinespace[0.5ex]
Non-zero Coefficients & $14$ & $28$ & $41$ & $7129$ & & $62$ & $2714$ & & $46$ \
addlinespace[0.5ex]
Non-zero Groups & -- & -- & -- & $2$ & & & $2$ & & \ bottomrule
endtabular
endtable
endlandscape
enddocument
How about this layout? I've put the caption above the table, which is the typographic traditional position, for obvious reasons. The booktabs
package defines horizontal rules with variable thickness and some vertical padding above and below. Furthermore, the cmidrule
s can help visualise the groups of columns, using their optional trimming arguments l
and r
:
documentclassarticle
usepackagemultirow
usepackagebooktabs, caption
usepackage[usestackEOL]stackengine
usepackagepdflscape
begindocument
beginlandscape
sectionTables
begintable[ht]
centering
defarraystretch1.5
setlengthcmidrulewidthlightrulewidth
setlengthtabcolsep4pt
captionThe performance of various models on the leukemia data set.
labelleuktable
begintabular@,lccc@qquadccc@qquadccc@,%
& multicolumn3cshortstackNo Clustering\ --hspace*2.5em & multicolumn3cshortstack$K$-means Clustering \ $K = 2$hspace*2.5em & multicolumn3cshortstackHierarchical Clustering\$K = 5$hspace*0.5em \
cmidrule(r2.5em)2-4 cmidrule(r2.5em)5-7 cmidrule(r0.5em)8-10
& Lasso & Elastic Net & pcLasso & gLasso & sgLasso & pcLasso & gLasso & sgLasso & pcLasso \ midrule
multirow1.75*Tuning Parameters & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ & $lambda = $ \[-1.5ex]
& -- & $alpha = 0.8$ & $textttrat = 0.95$ & -- & $alpha = $ & $textttrat = 0.95$ & -- & $alpha = $ & $textttrat = 0.95$ \
addlinespace[0.5ex]
Misclassifications & $5/36$ & $3/36$ & $3/36$ & $5/36$ & $/36$ & $2/36$ & $4/36$ & $/36$ & $2/36$ \
addlinespace[0.5ex]
Non-zero Coefficients & $14$ & $28$ & $41$ & $7129$ & & $62$ & $2714$ & & $46$ \
addlinespace[0.5ex]
Non-zero Groups & -- & -- & -- & $2$ & & & $2$ & & \ bottomrule
endtabular
endtable
endlandscape
enddocument
edited Jul 21 at 9:19
answered Jul 20 at 22:53
BernardBernard
197k8 gold badges88 silver badges233 bronze badges
197k8 gold badges88 silver badges233 bronze badges
Just curious, what makes you say putting the caption above the table is the "typographic traditional position"? From all of the papers I have read for this project, all captions have been below the table.
– Aiden Kenny
Jul 20 at 23:29
That is because if a table does not not fit on a single page, the reader usually doesn't want to have to turn pages to see what the table is about. . Of course, I was speaking of the times of manual typography. . You also may note that the floatrow package uses a similar syntax for rows of tables and rows of figures, but automatically places table captions above and figure captions below the float.
– Bernard
Jul 20 at 23:36
add a comment
|
Just curious, what makes you say putting the caption above the table is the "typographic traditional position"? From all of the papers I have read for this project, all captions have been below the table.
– Aiden Kenny
Jul 20 at 23:29
That is because if a table does not not fit on a single page, the reader usually doesn't want to have to turn pages to see what the table is about. . Of course, I was speaking of the times of manual typography. . You also may note that the floatrow package uses a similar syntax for rows of tables and rows of figures, but automatically places table captions above and figure captions below the float.
– Bernard
Jul 20 at 23:36
Just curious, what makes you say putting the caption above the table is the "typographic traditional position"? From all of the papers I have read for this project, all captions have been below the table.
– Aiden Kenny
Jul 20 at 23:29
Just curious, what makes you say putting the caption above the table is the "typographic traditional position"? From all of the papers I have read for this project, all captions have been below the table.
– Aiden Kenny
Jul 20 at 23:29
That is because if a table does not not fit on a single page, the reader usually doesn't want to have to turn pages to see what the table is about. . Of course, I was speaking of the times of manual typography. . You also may note that the floatrow package uses a similar syntax for rows of tables and rows of figures, but automatically places table captions above and figure captions below the float.
– Bernard
Jul 20 at 23:36
That is because if a table does not not fit on a single page, the reader usually doesn't want to have to turn pages to see what the table is about. . Of course, I was speaking of the times of manual typography. . You also may note that the floatrow package uses a similar syntax for rows of tables and rows of figures, but automatically places table captions above and figure captions below the float.
– Bernard
Jul 20 at 23:36
add a comment
|
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f500789%2ftable-formatting-suggestion%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
Have a look at booktabs doc. This a package devoted to improve the visual aspect of tables. This is done with different interline rules of different weights (and no vertical lines) and it largely improve tables, IMHO.
– Alain Merigot
Jul 20 at 21:54