Why is latex adding a newline when trying to create a table within a table?
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
I have this Latex code:
begintabularc
$h_fe = 70$ & $h_fe = 170$ & $h_fe = 250$ \
begintabularc
& textbfCalc. & textbfSim. & textbf% Diff. \
$I_C$ & 1.838 & 1.780 & 3.15 \
$V_B$ & 2.975& 2.992 & 0.57 \
$V_C$ & 6.692& 6.796 & 1.55\
$V_E$ & 2.210& 2.203& 0.32\
endtabular &
begintabularc
textbfCalc. & textbfSim. & textbfDiff \
&
endtabular &
begintabularc
textbfCalc. & textbfSim. & textbfDiff \
&
endtabular
endtabular
The output is:
How do I stop Latex from adding a leaving a space at the top of the 2nd and 3rd columns?
tables
New contributor
Rish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
2
down vote
favorite
I have this Latex code:
begintabularc
$h_fe = 70$ & $h_fe = 170$ & $h_fe = 250$ \
begintabularc
& textbfCalc. & textbfSim. & textbf% Diff. \
$I_C$ & 1.838 & 1.780 & 3.15 \
$V_B$ & 2.975& 2.992 & 0.57 \
$V_C$ & 6.692& 6.796 & 1.55\
$V_E$ & 2.210& 2.203& 0.32\
endtabular &
begintabularc
textbfCalc. & textbfSim. & textbfDiff \
&
endtabular &
begintabularc
textbfCalc. & textbfSim. & textbfDiff \
&
endtabular
endtabular
The output is:
How do I stop Latex from adding a leaving a space at the top of the 2nd and 3rd columns?
tables
New contributor
Rish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I have this Latex code:
begintabularc
$h_fe = 70$ & $h_fe = 170$ & $h_fe = 250$ \
begintabularc
& textbfCalc. & textbfSim. & textbf% Diff. \
$I_C$ & 1.838 & 1.780 & 3.15 \
$V_B$ & 2.975& 2.992 & 0.57 \
$V_C$ & 6.692& 6.796 & 1.55\
$V_E$ & 2.210& 2.203& 0.32\
endtabular &
begintabularc
textbfCalc. & textbfSim. & textbfDiff \
&
endtabular &
begintabularc
textbfCalc. & textbfSim. & textbfDiff \
&
endtabular
endtabular
The output is:
How do I stop Latex from adding a leaving a space at the top of the 2nd and 3rd columns?
tables
New contributor
Rish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I have this Latex code:
begintabularc
$h_fe = 70$ & $h_fe = 170$ & $h_fe = 250$ \
begintabularc
& textbfCalc. & textbfSim. & textbf% Diff. \
$I_C$ & 1.838 & 1.780 & 3.15 \
$V_B$ & 2.975& 2.992 & 0.57 \
$V_C$ & 6.692& 6.796 & 1.55\
$V_E$ & 2.210& 2.203& 0.32\
endtabular &
begintabularc
textbfCalc. & textbfSim. & textbfDiff \
&
endtabular &
begintabularc
textbfCalc. & textbfSim. & textbfDiff \
&
endtabular
endtabular
The output is:
How do I stop Latex from adding a leaving a space at the top of the 2nd and 3rd columns?
tables
tables
New contributor
Rish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Rish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Rish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 49 mins ago
Rish
111
111
New contributor
Rish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Rish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Rish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
4
down vote
You don't need to nest tabulars in the first place: use multicolumn
for spanning several columns.
documentclassarticle
begindocument
begintabularc
& multicolumn3$h_fe = 70$
& multicolumn3$h_fe = 170$
& multicolumn3$h_fe = 250$ \
& textbfCalc. & textbfSim. & textbf% Diff.
& textbfCalc. & textbfSim. & textbf% Diff.
& textbfCalc. & textbfSim. & textbf% Diff. \
$I_C$ & 1.838 & 1.780 & 3.15 & & & & & & \
$V_B$ & 2.975 & 2.992 & 0.57 & & & & & & \
$V_C$ & 6.692 & 6.796 & 1.55 & & & & & & \
$V_E$ & 2.210 & 2.203 & 0.32 & & & & & & \
endtabular
enddocument
A different realization that saves space and avoids the vertical rules. You can explain in the caption what “Câ€Â, “S†and “% D†mean.
documentclassarticle
usepackagesiunitx,booktabs
begindocument
begintabular
l
*3S[table-format=1.3] S[table-format=1.3] S[table-format=1.2]
toprule
& multicolumn3c$h_mathrmfe = 70$
& multicolumn3c$h_mathrmfe = 170$
& multicolumn3c$h_mathrmfe = 250$ \
cmidrule(lr)2-4 cmidrule(lr)5-7 cmidrule(lr)8-10
& C & S & % D & C & S & % D & C & S & % D \
midrule
$I_C$ & 1.838 & 1.780 & 3.15 & 1.111 & 2.222 & 3.3 & 4.444 & 5.555 & 6.6 \
$V_B$ & 2.975 & 2.992 & 0.57 & & & & & & \
$V_C$ & 6.692 & 6.796 & 1.55 & & & & & & \
$V_E$ & 2.210 & 2.203 & 0.32 & & & & & & \
bottomrule
endtabular
enddocument
add a comment |Â
up vote
3
down vote
Top-align [t]
all the inner tabular
s. By default, tabular
is vertically center-aligned.
documentclassarticle
begindocument
begintabularc
$h_fe = 70$ & $h_fe = 170$ & $h_fe = 250$ \
begintabular[t]c
& textbfCalc. & textbfSim. & textbf% Diff. \
$I_C$ & 1.838 & 1.780 & 3.15 \
$V_B$ & 2.975& 2.992 & 0.57 \
$V_C$ & 6.692& 6.796 & 1.55\
$V_E$ & 2.210& 2.203& 0.32\
endtabular &
begintabular[t]c
textbfCalc. & textbfSim. & textbfDiff \
&
endtabular &
begintabular[t]c
textbfCalc. & textbfSim. & textbfDiff \
&
endtabular
endtabular
enddocument
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
You don't need to nest tabulars in the first place: use multicolumn
for spanning several columns.
documentclassarticle
begindocument
begintabularc
& multicolumn3$h_fe = 70$
& multicolumn3$h_fe = 170$
& multicolumn3$h_fe = 250$ \
& textbfCalc. & textbfSim. & textbf% Diff.
& textbfCalc. & textbfSim. & textbf% Diff.
& textbfCalc. & textbfSim. & textbf% Diff. \
$I_C$ & 1.838 & 1.780 & 3.15 & & & & & & \
$V_B$ & 2.975 & 2.992 & 0.57 & & & & & & \
$V_C$ & 6.692 & 6.796 & 1.55 & & & & & & \
$V_E$ & 2.210 & 2.203 & 0.32 & & & & & & \
endtabular
enddocument
A different realization that saves space and avoids the vertical rules. You can explain in the caption what “Câ€Â, “S†and “% D†mean.
documentclassarticle
usepackagesiunitx,booktabs
begindocument
begintabular
l
*3S[table-format=1.3] S[table-format=1.3] S[table-format=1.2]
toprule
& multicolumn3c$h_mathrmfe = 70$
& multicolumn3c$h_mathrmfe = 170$
& multicolumn3c$h_mathrmfe = 250$ \
cmidrule(lr)2-4 cmidrule(lr)5-7 cmidrule(lr)8-10
& C & S & % D & C & S & % D & C & S & % D \
midrule
$I_C$ & 1.838 & 1.780 & 3.15 & 1.111 & 2.222 & 3.3 & 4.444 & 5.555 & 6.6 \
$V_B$ & 2.975 & 2.992 & 0.57 & & & & & & \
$V_C$ & 6.692 & 6.796 & 1.55 & & & & & & \
$V_E$ & 2.210 & 2.203 & 0.32 & & & & & & \
bottomrule
endtabular
enddocument
add a comment |Â
up vote
4
down vote
You don't need to nest tabulars in the first place: use multicolumn
for spanning several columns.
documentclassarticle
begindocument
begintabularc
& multicolumn3$h_fe = 70$
& multicolumn3$h_fe = 170$
& multicolumn3$h_fe = 250$ \
& textbfCalc. & textbfSim. & textbf% Diff.
& textbfCalc. & textbfSim. & textbf% Diff.
& textbfCalc. & textbfSim. & textbf% Diff. \
$I_C$ & 1.838 & 1.780 & 3.15 & & & & & & \
$V_B$ & 2.975 & 2.992 & 0.57 & & & & & & \
$V_C$ & 6.692 & 6.796 & 1.55 & & & & & & \
$V_E$ & 2.210 & 2.203 & 0.32 & & & & & & \
endtabular
enddocument
A different realization that saves space and avoids the vertical rules. You can explain in the caption what “Câ€Â, “S†and “% D†mean.
documentclassarticle
usepackagesiunitx,booktabs
begindocument
begintabular
l
*3S[table-format=1.3] S[table-format=1.3] S[table-format=1.2]
toprule
& multicolumn3c$h_mathrmfe = 70$
& multicolumn3c$h_mathrmfe = 170$
& multicolumn3c$h_mathrmfe = 250$ \
cmidrule(lr)2-4 cmidrule(lr)5-7 cmidrule(lr)8-10
& C & S & % D & C & S & % D & C & S & % D \
midrule
$I_C$ & 1.838 & 1.780 & 3.15 & 1.111 & 2.222 & 3.3 & 4.444 & 5.555 & 6.6 \
$V_B$ & 2.975 & 2.992 & 0.57 & & & & & & \
$V_C$ & 6.692 & 6.796 & 1.55 & & & & & & \
$V_E$ & 2.210 & 2.203 & 0.32 & & & & & & \
bottomrule
endtabular
enddocument
add a comment |Â
up vote
4
down vote
up vote
4
down vote
You don't need to nest tabulars in the first place: use multicolumn
for spanning several columns.
documentclassarticle
begindocument
begintabularc
& multicolumn3$h_fe = 70$
& multicolumn3$h_fe = 170$
& multicolumn3$h_fe = 250$ \
& textbfCalc. & textbfSim. & textbf% Diff.
& textbfCalc. & textbfSim. & textbf% Diff.
& textbfCalc. & textbfSim. & textbf% Diff. \
$I_C$ & 1.838 & 1.780 & 3.15 & & & & & & \
$V_B$ & 2.975 & 2.992 & 0.57 & & & & & & \
$V_C$ & 6.692 & 6.796 & 1.55 & & & & & & \
$V_E$ & 2.210 & 2.203 & 0.32 & & & & & & \
endtabular
enddocument
A different realization that saves space and avoids the vertical rules. You can explain in the caption what “Câ€Â, “S†and “% D†mean.
documentclassarticle
usepackagesiunitx,booktabs
begindocument
begintabular
l
*3S[table-format=1.3] S[table-format=1.3] S[table-format=1.2]
toprule
& multicolumn3c$h_mathrmfe = 70$
& multicolumn3c$h_mathrmfe = 170$
& multicolumn3c$h_mathrmfe = 250$ \
cmidrule(lr)2-4 cmidrule(lr)5-7 cmidrule(lr)8-10
& C & S & % D & C & S & % D & C & S & % D \
midrule
$I_C$ & 1.838 & 1.780 & 3.15 & 1.111 & 2.222 & 3.3 & 4.444 & 5.555 & 6.6 \
$V_B$ & 2.975 & 2.992 & 0.57 & & & & & & \
$V_C$ & 6.692 & 6.796 & 1.55 & & & & & & \
$V_E$ & 2.210 & 2.203 & 0.32 & & & & & & \
bottomrule
endtabular
enddocument
You don't need to nest tabulars in the first place: use multicolumn
for spanning several columns.
documentclassarticle
begindocument
begintabularc
& multicolumn3$h_fe = 70$
& multicolumn3$h_fe = 170$
& multicolumn3$h_fe = 250$ \
& textbfCalc. & textbfSim. & textbf% Diff.
& textbfCalc. & textbfSim. & textbf% Diff.
& textbfCalc. & textbfSim. & textbf% Diff. \
$I_C$ & 1.838 & 1.780 & 3.15 & & & & & & \
$V_B$ & 2.975 & 2.992 & 0.57 & & & & & & \
$V_C$ & 6.692 & 6.796 & 1.55 & & & & & & \
$V_E$ & 2.210 & 2.203 & 0.32 & & & & & & \
endtabular
enddocument
A different realization that saves space and avoids the vertical rules. You can explain in the caption what “Câ€Â, “S†and “% D†mean.
documentclassarticle
usepackagesiunitx,booktabs
begindocument
begintabular
l
*3S[table-format=1.3] S[table-format=1.3] S[table-format=1.2]
toprule
& multicolumn3c$h_mathrmfe = 70$
& multicolumn3c$h_mathrmfe = 170$
& multicolumn3c$h_mathrmfe = 250$ \
cmidrule(lr)2-4 cmidrule(lr)5-7 cmidrule(lr)8-10
& C & S & % D & C & S & % D & C & S & % D \
midrule
$I_C$ & 1.838 & 1.780 & 3.15 & 1.111 & 2.222 & 3.3 & 4.444 & 5.555 & 6.6 \
$V_B$ & 2.975 & 2.992 & 0.57 & & & & & & \
$V_C$ & 6.692 & 6.796 & 1.55 & & & & & & \
$V_E$ & 2.210 & 2.203 & 0.32 & & & & & & \
bottomrule
endtabular
enddocument
edited 32 mins ago
answered 40 mins ago


egreg
686k8418283078
686k8418283078
add a comment |Â
add a comment |Â
up vote
3
down vote
Top-align [t]
all the inner tabular
s. By default, tabular
is vertically center-aligned.
documentclassarticle
begindocument
begintabularc
$h_fe = 70$ & $h_fe = 170$ & $h_fe = 250$ \
begintabular[t]c
& textbfCalc. & textbfSim. & textbf% Diff. \
$I_C$ & 1.838 & 1.780 & 3.15 \
$V_B$ & 2.975& 2.992 & 0.57 \
$V_C$ & 6.692& 6.796 & 1.55\
$V_E$ & 2.210& 2.203& 0.32\
endtabular &
begintabular[t]c
textbfCalc. & textbfSim. & textbfDiff \
&
endtabular &
begintabular[t]c
textbfCalc. & textbfSim. & textbfDiff \
&
endtabular
endtabular
enddocument
add a comment |Â
up vote
3
down vote
Top-align [t]
all the inner tabular
s. By default, tabular
is vertically center-aligned.
documentclassarticle
begindocument
begintabularc
$h_fe = 70$ & $h_fe = 170$ & $h_fe = 250$ \
begintabular[t]c
& textbfCalc. & textbfSim. & textbf% Diff. \
$I_C$ & 1.838 & 1.780 & 3.15 \
$V_B$ & 2.975& 2.992 & 0.57 \
$V_C$ & 6.692& 6.796 & 1.55\
$V_E$ & 2.210& 2.203& 0.32\
endtabular &
begintabular[t]c
textbfCalc. & textbfSim. & textbfDiff \
&
endtabular &
begintabular[t]c
textbfCalc. & textbfSim. & textbfDiff \
&
endtabular
endtabular
enddocument
add a comment |Â
up vote
3
down vote
up vote
3
down vote
Top-align [t]
all the inner tabular
s. By default, tabular
is vertically center-aligned.
documentclassarticle
begindocument
begintabularc
$h_fe = 70$ & $h_fe = 170$ & $h_fe = 250$ \
begintabular[t]c
& textbfCalc. & textbfSim. & textbf% Diff. \
$I_C$ & 1.838 & 1.780 & 3.15 \
$V_B$ & 2.975& 2.992 & 0.57 \
$V_C$ & 6.692& 6.796 & 1.55\
$V_E$ & 2.210& 2.203& 0.32\
endtabular &
begintabular[t]c
textbfCalc. & textbfSim. & textbfDiff \
&
endtabular &
begintabular[t]c
textbfCalc. & textbfSim. & textbfDiff \
&
endtabular
endtabular
enddocument
Top-align [t]
all the inner tabular
s. By default, tabular
is vertically center-aligned.
documentclassarticle
begindocument
begintabularc
$h_fe = 70$ & $h_fe = 170$ & $h_fe = 250$ \
begintabular[t]c
& textbfCalc. & textbfSim. & textbf% Diff. \
$I_C$ & 1.838 & 1.780 & 3.15 \
$V_B$ & 2.975& 2.992 & 0.57 \
$V_C$ & 6.692& 6.796 & 1.55\
$V_E$ & 2.210& 2.203& 0.32\
endtabular &
begintabular[t]c
textbfCalc. & textbfSim. & textbfDiff \
&
endtabular &
begintabular[t]c
textbfCalc. & textbfSim. & textbfDiff \
&
endtabular
endtabular
enddocument
answered 43 mins ago


Steven B. Segletes
148k9186390
148k9186390
add a comment |Â
add a comment |Â
Rish is a new contributor. Be nice, and check out our Code of Conduct.
Rish is a new contributor. Be nice, and check out our Code of Conduct.
Rish is a new contributor. Be nice, and check out our Code of Conduct.
Rish 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%2f453448%2fwhy-is-latex-adding-a-newline-when-trying-to-create-a-table-within-a-table%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