How to correctly format a table with itemize
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
I have this LaTeX code
documentclassarticle
usepackagediagbox
usepackageamsmath,array,graphicx
begindocument
begintable[htb]
centering
captionClassifiaction
labeltable:cc
resizeboxcolumnwidth!%
begintabular*2hline
backslashboxClassificationModel
& Model 1 & Model 2 & Model 3 & Model 4\hlinehline
Class & Class 1 & beginitemize
item Class 1 if $A=B$
item Class 2 otherwise
enditemize & Class 2 & Class 2\hline
Method & Method 1 & Method 2 & Method 1 & Method 2\hline
Time & Constant & Linear & Polylogarithmic & Exponential \hline
endtabular
endtable
enddocument
which produces a table that contains a cell with itemized bullets. The table looks ugly as the text is not centred inside the cell, there are some useless space for example in the cell with items, the lines are not equally spaced, etc.
How can I improve this table?
I have tried to use this method of adding itemized bullets How to use itemize in Table environment but I did not succeed, i.e., when I use tabitem ....\ tabitem ...
the new item is not in the same cell but in a new line.
tables pdftex
New contributor
add a comment |Â
up vote
2
down vote
favorite
I have this LaTeX code
documentclassarticle
usepackagediagbox
usepackageamsmath,array,graphicx
begindocument
begintable[htb]
centering
captionClassifiaction
labeltable:cc
resizeboxcolumnwidth!%
begintabular*2hline
backslashboxClassificationModel
& Model 1 & Model 2 & Model 3 & Model 4\hlinehline
Class & Class 1 & beginitemize
item Class 1 if $A=B$
item Class 2 otherwise
enditemize & Class 2 & Class 2\hline
Method & Method 1 & Method 2 & Method 1 & Method 2\hline
Time & Constant & Linear & Polylogarithmic & Exponential \hline
endtabular
endtable
enddocument
which produces a table that contains a cell with itemized bullets. The table looks ugly as the text is not centred inside the cell, there are some useless space for example in the cell with items, the lines are not equally spaced, etc.
How can I improve this table?
I have tried to use this method of adding itemized bullets How to use itemize in Table environment but I did not succeed, i.e., when I use tabitem ....\ tabitem ...
the new item is not in the same cell but in a new line.
tables pdftex
New contributor
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I have this LaTeX code
documentclassarticle
usepackagediagbox
usepackageamsmath,array,graphicx
begindocument
begintable[htb]
centering
captionClassifiaction
labeltable:cc
resizeboxcolumnwidth!%
begintabular*2hline
backslashboxClassificationModel
& Model 1 & Model 2 & Model 3 & Model 4\hlinehline
Class & Class 1 & beginitemize
item Class 1 if $A=B$
item Class 2 otherwise
enditemize & Class 2 & Class 2\hline
Method & Method 1 & Method 2 & Method 1 & Method 2\hline
Time & Constant & Linear & Polylogarithmic & Exponential \hline
endtabular
endtable
enddocument
which produces a table that contains a cell with itemized bullets. The table looks ugly as the text is not centred inside the cell, there are some useless space for example in the cell with items, the lines are not equally spaced, etc.
How can I improve this table?
I have tried to use this method of adding itemized bullets How to use itemize in Table environment but I did not succeed, i.e., when I use tabitem ....\ tabitem ...
the new item is not in the same cell but in a new line.
tables pdftex
New contributor
I have this LaTeX code
documentclassarticle
usepackagediagbox
usepackageamsmath,array,graphicx
begindocument
begintable[htb]
centering
captionClassifiaction
labeltable:cc
resizeboxcolumnwidth!%
begintabular*2hline
backslashboxClassificationModel
& Model 1 & Model 2 & Model 3 & Model 4\hlinehline
Class & Class 1 & beginitemize
item Class 1 if $A=B$
item Class 2 otherwise
enditemize & Class 2 & Class 2\hline
Method & Method 1 & Method 2 & Method 1 & Method 2\hline
Time & Constant & Linear & Polylogarithmic & Exponential \hline
endtabular
endtable
enddocument
which produces a table that contains a cell with itemized bullets. The table looks ugly as the text is not centred inside the cell, there are some useless space for example in the cell with items, the lines are not equally spaced, etc.
How can I improve this table?
I have tried to use this method of adding itemized bullets How to use itemize in Table environment but I did not succeed, i.e., when I use tabitem ....\ tabitem ...
the new item is not in the same cell but in a new line.
tables pdftex
tables pdftex
New contributor
New contributor
edited 2 hours ago
New contributor
asked 2 hours ago
Zir
1114
1114
New contributor
New contributor
add a comment |Â
add a comment |Â
4 Answers
4
active
oldest
votes
up vote
2
down vote
Here's a solution that seems to provide what you want:
There are three keys here to what I'm doing:
- I've save the list in a box and prior to making the table. In the table I can then apply
usebox
to the box to obtain the already formatted content. By doing this, I can make the third column centers (as it appears you want). Using theminipage
removes the unwanted white space from before and after theitemize
list (provided there's no content outside of the list. - By using
raisebox
, I'm basically able to give the appearance of adding a buffer of white space above and below the list. This is a bit of a misnomer since what I've really done is just told LaTeX that the box's height and depth are a bit larger than they really are. The syntax forraisebox
is
;
raisebox<lift>
[<optional height specification>]
[<optional depth specification>]
<content>
- I use struts to create some control over the spacing.
Here's the code:
documentclassarticle
usepackagediagbox
usepackageamsmath,array,graphicx
newcommandaestrut[2]rule[#1]0pt1pt%%
rule[#2]0pt1pt
newcommandfixedstrutaestrut2.5ex-1.5ex
begindocument
newsaveboxaebox
beginlrboxaebox
beginminipage0.4textwidth-6pt
beginitemize
item Class 1 if $A=B$
item Class 2 otherwise
enditemize
endminipage%%
endlrbox
begintable[htb]
centering
captionClassifiactionaestrut0pt-2ex
labeltable:cc
resizeboxcolumnwidth!%
begintabular*1hline
backslashboxfixedstrut Classification
fixedstrut Model &
Model 1 &
Model 2 &
Model 3 &
Model 4
\hlinehline
Class &
Class 1 &
raisebox0pt[height+2ex][depth+2.5ex]useboxaebox
&
Class 2 &
Class 2
\hline
aestrut3ex-2ex%%
Method &
Method 1 &
Method 2 &
Method 1 &
Method 2
\hline
aestrut3ex-2ex%%
Time &
Constant &
Linear &
Polylogarithmic &
Exponential
\hline
endtabular
endtable
enddocument
Stackexchange Question: Who knows how to write this up so that I can insert code within a list? I threw in a spurious;
to get the desired effect. But there's got to be a better way. Right?
â A.Ellett
1 hour ago
add a comment |Â
up vote
2
down vote
i would redesign your table in the following form:
(red lines indicate text area borders)
documentclassarticle
usepackagebooktabs, multirow
usepackage[skip=1ex]caption
usepackageenumitem
begindocument
begintable[htb]
centering
setlengthtabcolsep0pt
captionClassifiaction
labeltable:cc
begintabular*linewidth@extracolsepfill *2l p0.28textwidth *2l
toprule
multirow2.2*Classification
& multicolumn4cModel \
cmidrule2-5
& Model 1 & Model 2 & Model 3 & Model 4 \
midrule
Class & Class 1 & beginitemize[nosep, leftmargin=*,
before=vspace-0.6baselineskip,
after =vspace-baselineskip
]
item Class 1 if $A=B$
item Class 2 otherwise
enditemize
& Class 2 & Class 2 \ midrule
Method & Method 1 & Method 2 & Method 1 & Method 2 \ midrule
Time & Constant & Linear & Polylogarithmic & Exponential \
bottomrule
endtabular*
endtable
enddocument
as you see, diagbox
is replaced with new row for "Model", "Classification" is placed into multirow
cell.
for table is used environment tabular*
, its width is equal to text width, for the list is used enumitem
package. vertical lines are removed, for horizontal ones are used rules from the package booktabs
.
add a comment |Â
up vote
2
down vote
Like this:
documentclassarticle
usepackagediagbox
usepackageamsmath,array,graphicx
begindocument
renewcommand*arraystretch2
begintable[htb]
centering
captionClassifiaction
labeltable:cc
resizeboxcolumnwidth!%
begintabular>centering m0.4textwidthhline
backslashboxClassificationModel
& Model 1 & Model 2 & Model 3 & Model 4\hlinehline
Class & Class 1 & beginitemize
item Class 1 if $A=B$
item Class 2 otherwise
enditemize & Class 2 & Class 2\hline
Method & Method 1 & Method 2 & Method 1 & Method 2\hline
Time & Constant & Linear & Polylogarithmic & Exponential \hline
endtabular
endtable
enddocument
Thanks. Can I increase the height of the third and fourth rows?
â Zir
2 hours ago
Also, can I center (in the middle) the contents of the cell containing the items?
â Zir
2 hours ago
withrenewcommandarraystretch2
for example the height of every row is doubled.
â Hafid Boukhoulda
2 hours ago
add a comment |Â
up vote
2
down vote
You shouldn't use resizebox
with tables â it leads to inconsistent font sizes. I propose a solution with the small
fontsize, a reduced tabcolsep
, a more decent text width with the geometry
package and tabularx
to make the table fit between margins. I reduced the first column width , playing with the height
and width
parameeters of diagbox
. For the liqst problem, I think it will look nicer left aligned at the left border of the cell, and without verical spacing. Last, I replaced hline
with hhline
to have nicer intersections between vertical and horizontal rules.
documentclassarticle
usepackage[showframe]geometry
usepackageamsmath, graphicx
usepackagediagbox
usepackagearray, caption, tabularx, hhline
usepackageenumitem
makeatletter
newcommand*compress@minipagetrue
makeatother
begindocument
begintable[htb]
centeringsmall
setlengthextrarowheight2pt
captionClassification
setlengthtabcolsep2pt
labeltable:cc
begintabularxlinewidth
hhline-
diagbox[height=7ex, width=9em]Classificationraisebox-1.6exModel
& Model 1 & Model 2 & Model 3 & Model 4\
hhline=::=::===
Class & Class 1 & beginitemize[wide=0pt, leftmargin=*, topsep=0pt, itemsep =0pt, after=vspace-baselineskip]
item Class 1 if $A=B$
item Class 2 otherwise
enditemize & Class 2 & Class 2\
hhline-
Method & Method 1 & Method 2 & Method 1 & Method 2\
hhline-
Time & Constant & Linear & Polylogarithmic & Exponential \
hhline-
endtabularx
endtable
enddocument
add a comment |Â
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
Here's a solution that seems to provide what you want:
There are three keys here to what I'm doing:
- I've save the list in a box and prior to making the table. In the table I can then apply
usebox
to the box to obtain the already formatted content. By doing this, I can make the third column centers (as it appears you want). Using theminipage
removes the unwanted white space from before and after theitemize
list (provided there's no content outside of the list. - By using
raisebox
, I'm basically able to give the appearance of adding a buffer of white space above and below the list. This is a bit of a misnomer since what I've really done is just told LaTeX that the box's height and depth are a bit larger than they really are. The syntax forraisebox
is
;
raisebox<lift>
[<optional height specification>]
[<optional depth specification>]
<content>
- I use struts to create some control over the spacing.
Here's the code:
documentclassarticle
usepackagediagbox
usepackageamsmath,array,graphicx
newcommandaestrut[2]rule[#1]0pt1pt%%
rule[#2]0pt1pt
newcommandfixedstrutaestrut2.5ex-1.5ex
begindocument
newsaveboxaebox
beginlrboxaebox
beginminipage0.4textwidth-6pt
beginitemize
item Class 1 if $A=B$
item Class 2 otherwise
enditemize
endminipage%%
endlrbox
begintable[htb]
centering
captionClassifiactionaestrut0pt-2ex
labeltable:cc
resizeboxcolumnwidth!%
begintabular*1hline
backslashboxfixedstrut Classification
fixedstrut Model &
Model 1 &
Model 2 &
Model 3 &
Model 4
\hlinehline
Class &
Class 1 &
raisebox0pt[height+2ex][depth+2.5ex]useboxaebox
&
Class 2 &
Class 2
\hline
aestrut3ex-2ex%%
Method &
Method 1 &
Method 2 &
Method 1 &
Method 2
\hline
aestrut3ex-2ex%%
Time &
Constant &
Linear &
Polylogarithmic &
Exponential
\hline
endtabular
endtable
enddocument
Stackexchange Question: Who knows how to write this up so that I can insert code within a list? I threw in a spurious;
to get the desired effect. But there's got to be a better way. Right?
â A.Ellett
1 hour ago
add a comment |Â
up vote
2
down vote
Here's a solution that seems to provide what you want:
There are three keys here to what I'm doing:
- I've save the list in a box and prior to making the table. In the table I can then apply
usebox
to the box to obtain the already formatted content. By doing this, I can make the third column centers (as it appears you want). Using theminipage
removes the unwanted white space from before and after theitemize
list (provided there's no content outside of the list. - By using
raisebox
, I'm basically able to give the appearance of adding a buffer of white space above and below the list. This is a bit of a misnomer since what I've really done is just told LaTeX that the box's height and depth are a bit larger than they really are. The syntax forraisebox
is
;
raisebox<lift>
[<optional height specification>]
[<optional depth specification>]
<content>
- I use struts to create some control over the spacing.
Here's the code:
documentclassarticle
usepackagediagbox
usepackageamsmath,array,graphicx
newcommandaestrut[2]rule[#1]0pt1pt%%
rule[#2]0pt1pt
newcommandfixedstrutaestrut2.5ex-1.5ex
begindocument
newsaveboxaebox
beginlrboxaebox
beginminipage0.4textwidth-6pt
beginitemize
item Class 1 if $A=B$
item Class 2 otherwise
enditemize
endminipage%%
endlrbox
begintable[htb]
centering
captionClassifiactionaestrut0pt-2ex
labeltable:cc
resizeboxcolumnwidth!%
begintabular*1hline
backslashboxfixedstrut Classification
fixedstrut Model &
Model 1 &
Model 2 &
Model 3 &
Model 4
\hlinehline
Class &
Class 1 &
raisebox0pt[height+2ex][depth+2.5ex]useboxaebox
&
Class 2 &
Class 2
\hline
aestrut3ex-2ex%%
Method &
Method 1 &
Method 2 &
Method 1 &
Method 2
\hline
aestrut3ex-2ex%%
Time &
Constant &
Linear &
Polylogarithmic &
Exponential
\hline
endtabular
endtable
enddocument
Stackexchange Question: Who knows how to write this up so that I can insert code within a list? I threw in a spurious;
to get the desired effect. But there's got to be a better way. Right?
â A.Ellett
1 hour ago
add a comment |Â
up vote
2
down vote
up vote
2
down vote
Here's a solution that seems to provide what you want:
There are three keys here to what I'm doing:
- I've save the list in a box and prior to making the table. In the table I can then apply
usebox
to the box to obtain the already formatted content. By doing this, I can make the third column centers (as it appears you want). Using theminipage
removes the unwanted white space from before and after theitemize
list (provided there's no content outside of the list. - By using
raisebox
, I'm basically able to give the appearance of adding a buffer of white space above and below the list. This is a bit of a misnomer since what I've really done is just told LaTeX that the box's height and depth are a bit larger than they really are. The syntax forraisebox
is
;
raisebox<lift>
[<optional height specification>]
[<optional depth specification>]
<content>
- I use struts to create some control over the spacing.
Here's the code:
documentclassarticle
usepackagediagbox
usepackageamsmath,array,graphicx
newcommandaestrut[2]rule[#1]0pt1pt%%
rule[#2]0pt1pt
newcommandfixedstrutaestrut2.5ex-1.5ex
begindocument
newsaveboxaebox
beginlrboxaebox
beginminipage0.4textwidth-6pt
beginitemize
item Class 1 if $A=B$
item Class 2 otherwise
enditemize
endminipage%%
endlrbox
begintable[htb]
centering
captionClassifiactionaestrut0pt-2ex
labeltable:cc
resizeboxcolumnwidth!%
begintabular*1hline
backslashboxfixedstrut Classification
fixedstrut Model &
Model 1 &
Model 2 &
Model 3 &
Model 4
\hlinehline
Class &
Class 1 &
raisebox0pt[height+2ex][depth+2.5ex]useboxaebox
&
Class 2 &
Class 2
\hline
aestrut3ex-2ex%%
Method &
Method 1 &
Method 2 &
Method 1 &
Method 2
\hline
aestrut3ex-2ex%%
Time &
Constant &
Linear &
Polylogarithmic &
Exponential
\hline
endtabular
endtable
enddocument
Here's a solution that seems to provide what you want:
There are three keys here to what I'm doing:
- I've save the list in a box and prior to making the table. In the table I can then apply
usebox
to the box to obtain the already formatted content. By doing this, I can make the third column centers (as it appears you want). Using theminipage
removes the unwanted white space from before and after theitemize
list (provided there's no content outside of the list. - By using
raisebox
, I'm basically able to give the appearance of adding a buffer of white space above and below the list. This is a bit of a misnomer since what I've really done is just told LaTeX that the box's height and depth are a bit larger than they really are. The syntax forraisebox
is
;
raisebox<lift>
[<optional height specification>]
[<optional depth specification>]
<content>
- I use struts to create some control over the spacing.
Here's the code:
documentclassarticle
usepackagediagbox
usepackageamsmath,array,graphicx
newcommandaestrut[2]rule[#1]0pt1pt%%
rule[#2]0pt1pt
newcommandfixedstrutaestrut2.5ex-1.5ex
begindocument
newsaveboxaebox
beginlrboxaebox
beginminipage0.4textwidth-6pt
beginitemize
item Class 1 if $A=B$
item Class 2 otherwise
enditemize
endminipage%%
endlrbox
begintable[htb]
centering
captionClassifiactionaestrut0pt-2ex
labeltable:cc
resizeboxcolumnwidth!%
begintabular*1hline
backslashboxfixedstrut Classification
fixedstrut Model &
Model 1 &
Model 2 &
Model 3 &
Model 4
\hlinehline
Class &
Class 1 &
raisebox0pt[height+2ex][depth+2.5ex]useboxaebox
&
Class 2 &
Class 2
\hline
aestrut3ex-2ex%%
Method &
Method 1 &
Method 2 &
Method 1 &
Method 2
\hline
aestrut3ex-2ex%%
Time &
Constant &
Linear &
Polylogarithmic &
Exponential
\hline
endtabular
endtable
enddocument
edited 2 hours ago
answered 2 hours ago
A.Ellett
35.3k1063163
35.3k1063163
Stackexchange Question: Who knows how to write this up so that I can insert code within a list? I threw in a spurious;
to get the desired effect. But there's got to be a better way. Right?
â A.Ellett
1 hour ago
add a comment |Â
Stackexchange Question: Who knows how to write this up so that I can insert code within a list? I threw in a spurious;
to get the desired effect. But there's got to be a better way. Right?
â A.Ellett
1 hour ago
Stackexchange Question: Who knows how to write this up so that I can insert code within a list? I threw in a spurious
;
to get the desired effect. But there's got to be a better way. Right?â A.Ellett
1 hour ago
Stackexchange Question: Who knows how to write this up so that I can insert code within a list? I threw in a spurious
;
to get the desired effect. But there's got to be a better way. Right?â A.Ellett
1 hour ago
add a comment |Â
up vote
2
down vote
i would redesign your table in the following form:
(red lines indicate text area borders)
documentclassarticle
usepackagebooktabs, multirow
usepackage[skip=1ex]caption
usepackageenumitem
begindocument
begintable[htb]
centering
setlengthtabcolsep0pt
captionClassifiaction
labeltable:cc
begintabular*linewidth@extracolsepfill *2l p0.28textwidth *2l
toprule
multirow2.2*Classification
& multicolumn4cModel \
cmidrule2-5
& Model 1 & Model 2 & Model 3 & Model 4 \
midrule
Class & Class 1 & beginitemize[nosep, leftmargin=*,
before=vspace-0.6baselineskip,
after =vspace-baselineskip
]
item Class 1 if $A=B$
item Class 2 otherwise
enditemize
& Class 2 & Class 2 \ midrule
Method & Method 1 & Method 2 & Method 1 & Method 2 \ midrule
Time & Constant & Linear & Polylogarithmic & Exponential \
bottomrule
endtabular*
endtable
enddocument
as you see, diagbox
is replaced with new row for "Model", "Classification" is placed into multirow
cell.
for table is used environment tabular*
, its width is equal to text width, for the list is used enumitem
package. vertical lines are removed, for horizontal ones are used rules from the package booktabs
.
add a comment |Â
up vote
2
down vote
i would redesign your table in the following form:
(red lines indicate text area borders)
documentclassarticle
usepackagebooktabs, multirow
usepackage[skip=1ex]caption
usepackageenumitem
begindocument
begintable[htb]
centering
setlengthtabcolsep0pt
captionClassifiaction
labeltable:cc
begintabular*linewidth@extracolsepfill *2l p0.28textwidth *2l
toprule
multirow2.2*Classification
& multicolumn4cModel \
cmidrule2-5
& Model 1 & Model 2 & Model 3 & Model 4 \
midrule
Class & Class 1 & beginitemize[nosep, leftmargin=*,
before=vspace-0.6baselineskip,
after =vspace-baselineskip
]
item Class 1 if $A=B$
item Class 2 otherwise
enditemize
& Class 2 & Class 2 \ midrule
Method & Method 1 & Method 2 & Method 1 & Method 2 \ midrule
Time & Constant & Linear & Polylogarithmic & Exponential \
bottomrule
endtabular*
endtable
enddocument
as you see, diagbox
is replaced with new row for "Model", "Classification" is placed into multirow
cell.
for table is used environment tabular*
, its width is equal to text width, for the list is used enumitem
package. vertical lines are removed, for horizontal ones are used rules from the package booktabs
.
add a comment |Â
up vote
2
down vote
up vote
2
down vote
i would redesign your table in the following form:
(red lines indicate text area borders)
documentclassarticle
usepackagebooktabs, multirow
usepackage[skip=1ex]caption
usepackageenumitem
begindocument
begintable[htb]
centering
setlengthtabcolsep0pt
captionClassifiaction
labeltable:cc
begintabular*linewidth@extracolsepfill *2l p0.28textwidth *2l
toprule
multirow2.2*Classification
& multicolumn4cModel \
cmidrule2-5
& Model 1 & Model 2 & Model 3 & Model 4 \
midrule
Class & Class 1 & beginitemize[nosep, leftmargin=*,
before=vspace-0.6baselineskip,
after =vspace-baselineskip
]
item Class 1 if $A=B$
item Class 2 otherwise
enditemize
& Class 2 & Class 2 \ midrule
Method & Method 1 & Method 2 & Method 1 & Method 2 \ midrule
Time & Constant & Linear & Polylogarithmic & Exponential \
bottomrule
endtabular*
endtable
enddocument
as you see, diagbox
is replaced with new row for "Model", "Classification" is placed into multirow
cell.
for table is used environment tabular*
, its width is equal to text width, for the list is used enumitem
package. vertical lines are removed, for horizontal ones are used rules from the package booktabs
.
i would redesign your table in the following form:
(red lines indicate text area borders)
documentclassarticle
usepackagebooktabs, multirow
usepackage[skip=1ex]caption
usepackageenumitem
begindocument
begintable[htb]
centering
setlengthtabcolsep0pt
captionClassifiaction
labeltable:cc
begintabular*linewidth@extracolsepfill *2l p0.28textwidth *2l
toprule
multirow2.2*Classification
& multicolumn4cModel \
cmidrule2-5
& Model 1 & Model 2 & Model 3 & Model 4 \
midrule
Class & Class 1 & beginitemize[nosep, leftmargin=*,
before=vspace-0.6baselineskip,
after =vspace-baselineskip
]
item Class 1 if $A=B$
item Class 2 otherwise
enditemize
& Class 2 & Class 2 \ midrule
Method & Method 1 & Method 2 & Method 1 & Method 2 \ midrule
Time & Constant & Linear & Polylogarithmic & Exponential \
bottomrule
endtabular*
endtable
enddocument
as you see, diagbox
is replaced with new row for "Model", "Classification" is placed into multirow
cell.
for table is used environment tabular*
, its width is equal to text width, for the list is used enumitem
package. vertical lines are removed, for horizontal ones are used rules from the package booktabs
.
answered 1 hour ago
Zarko
114k863152
114k863152
add a comment |Â
add a comment |Â
up vote
2
down vote
Like this:
documentclassarticle
usepackagediagbox
usepackageamsmath,array,graphicx
begindocument
renewcommand*arraystretch2
begintable[htb]
centering
captionClassifiaction
labeltable:cc
resizeboxcolumnwidth!%
begintabular>centering m0.4textwidthhline
backslashboxClassificationModel
& Model 1 & Model 2 & Model 3 & Model 4\hlinehline
Class & Class 1 & beginitemize
item Class 1 if $A=B$
item Class 2 otherwise
enditemize & Class 2 & Class 2\hline
Method & Method 1 & Method 2 & Method 1 & Method 2\hline
Time & Constant & Linear & Polylogarithmic & Exponential \hline
endtabular
endtable
enddocument
Thanks. Can I increase the height of the third and fourth rows?
â Zir
2 hours ago
Also, can I center (in the middle) the contents of the cell containing the items?
â Zir
2 hours ago
withrenewcommandarraystretch2
for example the height of every row is doubled.
â Hafid Boukhoulda
2 hours ago
add a comment |Â
up vote
2
down vote
Like this:
documentclassarticle
usepackagediagbox
usepackageamsmath,array,graphicx
begindocument
renewcommand*arraystretch2
begintable[htb]
centering
captionClassifiaction
labeltable:cc
resizeboxcolumnwidth!%
begintabular>centering m0.4textwidthhline
backslashboxClassificationModel
& Model 1 & Model 2 & Model 3 & Model 4\hlinehline
Class & Class 1 & beginitemize
item Class 1 if $A=B$
item Class 2 otherwise
enditemize & Class 2 & Class 2\hline
Method & Method 1 & Method 2 & Method 1 & Method 2\hline
Time & Constant & Linear & Polylogarithmic & Exponential \hline
endtabular
endtable
enddocument
Thanks. Can I increase the height of the third and fourth rows?
â Zir
2 hours ago
Also, can I center (in the middle) the contents of the cell containing the items?
â Zir
2 hours ago
withrenewcommandarraystretch2
for example the height of every row is doubled.
â Hafid Boukhoulda
2 hours ago
add a comment |Â
up vote
2
down vote
up vote
2
down vote
Like this:
documentclassarticle
usepackagediagbox
usepackageamsmath,array,graphicx
begindocument
renewcommand*arraystretch2
begintable[htb]
centering
captionClassifiaction
labeltable:cc
resizeboxcolumnwidth!%
begintabular>centering m0.4textwidthhline
backslashboxClassificationModel
& Model 1 & Model 2 & Model 3 & Model 4\hlinehline
Class & Class 1 & beginitemize
item Class 1 if $A=B$
item Class 2 otherwise
enditemize & Class 2 & Class 2\hline
Method & Method 1 & Method 2 & Method 1 & Method 2\hline
Time & Constant & Linear & Polylogarithmic & Exponential \hline
endtabular
endtable
enddocument
Like this:
documentclassarticle
usepackagediagbox
usepackageamsmath,array,graphicx
begindocument
renewcommand*arraystretch2
begintable[htb]
centering
captionClassifiaction
labeltable:cc
resizeboxcolumnwidth!%
begintabular>centering m0.4textwidthhline
backslashboxClassificationModel
& Model 1 & Model 2 & Model 3 & Model 4\hlinehline
Class & Class 1 & beginitemize
item Class 1 if $A=B$
item Class 2 otherwise
enditemize & Class 2 & Class 2\hline
Method & Method 1 & Method 2 & Method 1 & Method 2\hline
Time & Constant & Linear & Polylogarithmic & Exponential \hline
endtabular
endtable
enddocument
edited 1 hour ago
answered 2 hours ago
Hafid Boukhoulda
841313
841313
Thanks. Can I increase the height of the third and fourth rows?
â Zir
2 hours ago
Also, can I center (in the middle) the contents of the cell containing the items?
â Zir
2 hours ago
withrenewcommandarraystretch2
for example the height of every row is doubled.
â Hafid Boukhoulda
2 hours ago
add a comment |Â
Thanks. Can I increase the height of the third and fourth rows?
â Zir
2 hours ago
Also, can I center (in the middle) the contents of the cell containing the items?
â Zir
2 hours ago
withrenewcommandarraystretch2
for example the height of every row is doubled.
â Hafid Boukhoulda
2 hours ago
Thanks. Can I increase the height of the third and fourth rows?
â Zir
2 hours ago
Thanks. Can I increase the height of the third and fourth rows?
â Zir
2 hours ago
Also, can I center (in the middle) the contents of the cell containing the items?
â Zir
2 hours ago
Also, can I center (in the middle) the contents of the cell containing the items?
â Zir
2 hours ago
with
renewcommandarraystretch2
for example the height of every row is doubled.â Hafid Boukhoulda
2 hours ago
with
renewcommandarraystretch2
for example the height of every row is doubled.â Hafid Boukhoulda
2 hours ago
add a comment |Â
up vote
2
down vote
You shouldn't use resizebox
with tables â it leads to inconsistent font sizes. I propose a solution with the small
fontsize, a reduced tabcolsep
, a more decent text width with the geometry
package and tabularx
to make the table fit between margins. I reduced the first column width , playing with the height
and width
parameeters of diagbox
. For the liqst problem, I think it will look nicer left aligned at the left border of the cell, and without verical spacing. Last, I replaced hline
with hhline
to have nicer intersections between vertical and horizontal rules.
documentclassarticle
usepackage[showframe]geometry
usepackageamsmath, graphicx
usepackagediagbox
usepackagearray, caption, tabularx, hhline
usepackageenumitem
makeatletter
newcommand*compress@minipagetrue
makeatother
begindocument
begintable[htb]
centeringsmall
setlengthextrarowheight2pt
captionClassification
setlengthtabcolsep2pt
labeltable:cc
begintabularxlinewidth
hhline-
diagbox[height=7ex, width=9em]Classificationraisebox-1.6exModel
& Model 1 & Model 2 & Model 3 & Model 4\
hhline=::=::===
Class & Class 1 & beginitemize[wide=0pt, leftmargin=*, topsep=0pt, itemsep =0pt, after=vspace-baselineskip]
item Class 1 if $A=B$
item Class 2 otherwise
enditemize & Class 2 & Class 2\
hhline-
Method & Method 1 & Method 2 & Method 1 & Method 2\
hhline-
Time & Constant & Linear & Polylogarithmic & Exponential \
hhline-
endtabularx
endtable
enddocument
add a comment |Â
up vote
2
down vote
You shouldn't use resizebox
with tables â it leads to inconsistent font sizes. I propose a solution with the small
fontsize, a reduced tabcolsep
, a more decent text width with the geometry
package and tabularx
to make the table fit between margins. I reduced the first column width , playing with the height
and width
parameeters of diagbox
. For the liqst problem, I think it will look nicer left aligned at the left border of the cell, and without verical spacing. Last, I replaced hline
with hhline
to have nicer intersections between vertical and horizontal rules.
documentclassarticle
usepackage[showframe]geometry
usepackageamsmath, graphicx
usepackagediagbox
usepackagearray, caption, tabularx, hhline
usepackageenumitem
makeatletter
newcommand*compress@minipagetrue
makeatother
begindocument
begintable[htb]
centeringsmall
setlengthextrarowheight2pt
captionClassification
setlengthtabcolsep2pt
labeltable:cc
begintabularxlinewidth
hhline-
diagbox[height=7ex, width=9em]Classificationraisebox-1.6exModel
& Model 1 & Model 2 & Model 3 & Model 4\
hhline=::=::===
Class & Class 1 & beginitemize[wide=0pt, leftmargin=*, topsep=0pt, itemsep =0pt, after=vspace-baselineskip]
item Class 1 if $A=B$
item Class 2 otherwise
enditemize & Class 2 & Class 2\
hhline-
Method & Method 1 & Method 2 & Method 1 & Method 2\
hhline-
Time & Constant & Linear & Polylogarithmic & Exponential \
hhline-
endtabularx
endtable
enddocument
add a comment |Â
up vote
2
down vote
up vote
2
down vote
You shouldn't use resizebox
with tables â it leads to inconsistent font sizes. I propose a solution with the small
fontsize, a reduced tabcolsep
, a more decent text width with the geometry
package and tabularx
to make the table fit between margins. I reduced the first column width , playing with the height
and width
parameeters of diagbox
. For the liqst problem, I think it will look nicer left aligned at the left border of the cell, and without verical spacing. Last, I replaced hline
with hhline
to have nicer intersections between vertical and horizontal rules.
documentclassarticle
usepackage[showframe]geometry
usepackageamsmath, graphicx
usepackagediagbox
usepackagearray, caption, tabularx, hhline
usepackageenumitem
makeatletter
newcommand*compress@minipagetrue
makeatother
begindocument
begintable[htb]
centeringsmall
setlengthextrarowheight2pt
captionClassification
setlengthtabcolsep2pt
labeltable:cc
begintabularxlinewidth
hhline-
diagbox[height=7ex, width=9em]Classificationraisebox-1.6exModel
& Model 1 & Model 2 & Model 3 & Model 4\
hhline=::=::===
Class & Class 1 & beginitemize[wide=0pt, leftmargin=*, topsep=0pt, itemsep =0pt, after=vspace-baselineskip]
item Class 1 if $A=B$
item Class 2 otherwise
enditemize & Class 2 & Class 2\
hhline-
Method & Method 1 & Method 2 & Method 1 & Method 2\
hhline-
Time & Constant & Linear & Polylogarithmic & Exponential \
hhline-
endtabularx
endtable
enddocument
You shouldn't use resizebox
with tables â it leads to inconsistent font sizes. I propose a solution with the small
fontsize, a reduced tabcolsep
, a more decent text width with the geometry
package and tabularx
to make the table fit between margins. I reduced the first column width , playing with the height
and width
parameeters of diagbox
. For the liqst problem, I think it will look nicer left aligned at the left border of the cell, and without verical spacing. Last, I replaced hline
with hhline
to have nicer intersections between vertical and horizontal rules.
documentclassarticle
usepackage[showframe]geometry
usepackageamsmath, graphicx
usepackagediagbox
usepackagearray, caption, tabularx, hhline
usepackageenumitem
makeatletter
newcommand*compress@minipagetrue
makeatother
begindocument
begintable[htb]
centeringsmall
setlengthextrarowheight2pt
captionClassification
setlengthtabcolsep2pt
labeltable:cc
begintabularxlinewidth
hhline-
diagbox[height=7ex, width=9em]Classificationraisebox-1.6exModel
& Model 1 & Model 2 & Model 3 & Model 4\
hhline=::=::===
Class & Class 1 & beginitemize[wide=0pt, leftmargin=*, topsep=0pt, itemsep =0pt, after=vspace-baselineskip]
item Class 1 if $A=B$
item Class 2 otherwise
enditemize & Class 2 & Class 2\
hhline-
Method & Method 1 & Method 2 & Method 1 & Method 2\
hhline-
Time & Constant & Linear & Polylogarithmic & Exponential \
hhline-
endtabularx
endtable
enddocument
answered 53 mins ago
Bernard
158k764191
158k764191
add a comment |Â
add a comment |Â
Zir is a new contributor. Be nice, and check out our Code of Conduct.
Zir is a new contributor. Be nice, and check out our Code of Conduct.
Zir is a new contributor. Be nice, and check out our Code of Conduct.
Zir is a new contributor. Be nice, and check out our Code of Conduct.
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f454533%2fhow-to-correctly-format-a-table-with-itemize%23new-answer', 'question_page');
);
Post as a guest
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
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
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