Automatic amount table columns and column numbers

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












4















I'm looking for a way to create a command with which Latex can automatically generate a table with a given amount of columns, and automatically fills in the column numbers as headers.



I'm looking for something like this:



newcommandCountBox[1]
beginflushright
begintabular*#1
hline
multicolumn1c1 #1 \ hline
#1 \ hline
endtabular
endflushright



Where the following command creates the following table:



CountBox6


6 Column Table



And the following command creates the following table:



CountBox3


3 Column Table



I seem to get stuck on having to manually input the ampersands into the multicolumn command (have tried loop, while, and expandafter)



Thanks for the help!




Just in case the original code for the 6 column table:



beginflushright
begintabular*7
hline
multicolumn1c1 & 2 & 3 & 4 & 5 & 6 \ hline
& & & & & \ hline

endtabular
endflushright









share|improve this question






















  • tex.stackexchange.com/questions/165625/… might be helpful

    – samcarter
    Jan 4 at 15:25











  • any reason for centering the 1 in its cell and not the others ?

    – jfbu
    Jan 4 at 18:40















4















I'm looking for a way to create a command with which Latex can automatically generate a table with a given amount of columns, and automatically fills in the column numbers as headers.



I'm looking for something like this:



newcommandCountBox[1]
beginflushright
begintabular*#1
hline
multicolumn1c1 #1 \ hline
#1 \ hline
endtabular
endflushright



Where the following command creates the following table:



CountBox6


6 Column Table



And the following command creates the following table:



CountBox3


3 Column Table



I seem to get stuck on having to manually input the ampersands into the multicolumn command (have tried loop, while, and expandafter)



Thanks for the help!




Just in case the original code for the 6 column table:



beginflushright
begintabular*7
hline
multicolumn1c1 & 2 & 3 & 4 & 5 & 6 \ hline
& & & & & \ hline

endtabular
endflushright









share|improve this question






















  • tex.stackexchange.com/questions/165625/… might be helpful

    – samcarter
    Jan 4 at 15:25











  • any reason for centering the 1 in its cell and not the others ?

    – jfbu
    Jan 4 at 18:40













4












4








4


0






I'm looking for a way to create a command with which Latex can automatically generate a table with a given amount of columns, and automatically fills in the column numbers as headers.



I'm looking for something like this:



newcommandCountBox[1]
beginflushright
begintabular*#1
hline
multicolumn1c1 #1 \ hline
#1 \ hline
endtabular
endflushright



Where the following command creates the following table:



CountBox6


6 Column Table



And the following command creates the following table:



CountBox3


3 Column Table



I seem to get stuck on having to manually input the ampersands into the multicolumn command (have tried loop, while, and expandafter)



Thanks for the help!




Just in case the original code for the 6 column table:



beginflushright
begintabular*7
hline
multicolumn1c1 & 2 & 3 & 4 & 5 & 6 \ hline
& & & & & \ hline

endtabular
endflushright









share|improve this question














I'm looking for a way to create a command with which Latex can automatically generate a table with a given amount of columns, and automatically fills in the column numbers as headers.



I'm looking for something like this:



newcommandCountBox[1]
beginflushright
begintabular*#1
hline
multicolumn1c1 #1 \ hline
#1 \ hline
endtabular
endflushright



Where the following command creates the following table:



CountBox6


6 Column Table



And the following command creates the following table:



CountBox3


3 Column Table



I seem to get stuck on having to manually input the ampersands into the multicolumn command (have tried loop, while, and expandafter)



Thanks for the help!




Just in case the original code for the 6 column table:



beginflushright
begintabular*7
hline
multicolumn1c1 & 2 & 3 & 4 & 5 & 6 \ hline
& & & & & \ hline

endtabular
endflushright






tables multicolumn automation






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 4 at 15:13









PhlempPhlemp

233




233












  • tex.stackexchange.com/questions/165625/… might be helpful

    – samcarter
    Jan 4 at 15:25











  • any reason for centering the 1 in its cell and not the others ?

    – jfbu
    Jan 4 at 18:40

















  • tex.stackexchange.com/questions/165625/… might be helpful

    – samcarter
    Jan 4 at 15:25











  • any reason for centering the 1 in its cell and not the others ?

    – jfbu
    Jan 4 at 18:40
















tex.stackexchange.com/questions/165625/… might be helpful

– samcarter
Jan 4 at 15:25





tex.stackexchange.com/questions/165625/… might be helpful

– samcarter
Jan 4 at 15:25













any reason for centering the 1 in its cell and not the others ?

– jfbu
Jan 4 at 18:40





any reason for centering the 1 in its cell and not the others ?

– jfbu
Jan 4 at 18:40










3 Answers
3






active

oldest

votes


















2














With foreach in TikZ:



documentclassarticle 
usepackagetikz
usepackageetoolbox
usetikzlibrary
positioning,
shapes.multipart

tikzset
mynode/.style=
draw,
rectangle split,
rectangle split parts=2,
text centered,
,

newcommandCountBox[1]%
begintikzpicture
node[mynode] (1) 1;
ifnumcomp#1=1%
foreach mynum
[evaluate=mynum as myprev using int(mynum-1)]
in 2,...,#1
node[mynode,xshift=-pgflinewidth,anchor=west] (mynum) at (myprev.east) mynum;
%
endtikzpicture%


begindocument
CountBox1

CountBox3

CountBox6

CountBox2
CountBox4
CountBox7
enddocument


enter image description here






share|improve this answer























  • Thank you for the response! Works like a charm.

    – Phlemp
    Jan 5 at 14:19











  • @Phlemp You're welcome, thank you for accepting my answer!

    – CarLaTeX
    Jan 5 at 16:33


















5














Here is an expl3 implementation. With the help of array and its w column specifier, all columns can be made as wide as the last (with the largest number).



documentclassarticle

usepackagexparse,array

ExplSyntaxOn
NewDocumentCommandCountBoxm

% measure the wider number
hbox_set:Nn l_tmpa_box #1
dim_set:Nn l_tmpa_dim box_wd:N l_tmpa_box
% do as many columns as specified
begintabular*#1
hline
% do '<number> &' one less than specified, then add the last number
int_step_function:nN #1 - 1 __phlemp_countbox_head:n #1 \
hline
% generate as many &'s as necessary to fill the second row
prg_replicate:nn #1 - 1 & \
hline
endtabular


% auxiliary function for adding the & after the number
cs_new_protected:Nn __phlemp_countbox_head:n #1 &
ExplSyntaxOff

begindocument

CountBox3 CountBox10

enddocument


enter image description here






share|improve this answer























  • Thanks for the quick response! It produced a lot of illegal pream-tokens on my side though (working in Overleaf). Also did not allow the _ outside of math-mode, and an undefined control sequence on " int_step_function:nN ". Is that something I can fix or have to install something for? Much appreciated.

    – Phlemp
    Jan 5 at 14:23



















3














The following uses multido to generate the column numbering sequence and blank row. A similar approach to egreg's uses array's w<align><width> to set the column width to the widest element:



enter image description here



documentclassarticle

usepackagemultido,array

newcounterboxCount
newlengthboxCountwd

makeatletter
newcommandCountBox[1]%
setcounterboxCount0% Reset boxCount
settowidthboxCountwd#1% Measure widest element
defCountBoxSeq@gobble%
defCountBoxSeqPhantom@gobble%
multidoi=1+1#1%
xdefCountBoxSeqCountBoxSeq & i%
xdefCountBoxSeqPhantomCountBoxSeqPhantom &%
%
noindent
begintabular *#1
hline
CountBoxSeq \
hline
CountBoxSeqPhantom \
hline
endtabular%

makeatother

begindocument

CountBox5

enddocument





share|improve this answer























  • Thanks for the reply! When I try compiling it produces illegal pream tokens on the "w" and on the "boxCountwd" in the tabular. I don't know how to fix it. Working in Overleaf. Really appreciate your help!

    – Phlemp
    Jan 5 at 14:25












  • @Phlemp: Did you add usepackagearray to your preamble like I did? Probably not. You don't have to use wc.. as a column specification. It just aids in making the column widths the same if you have 10 or more columns. Alternatively, just use c, l or r.

    – Werner
    Jan 5 at 17:22










Your Answer








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

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

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f468575%2fautomatic-amount-table-columns-and-column-numbers%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























3 Answers
3






active

oldest

votes








3 Answers
3






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














With foreach in TikZ:



documentclassarticle 
usepackagetikz
usepackageetoolbox
usetikzlibrary
positioning,
shapes.multipart

tikzset
mynode/.style=
draw,
rectangle split,
rectangle split parts=2,
text centered,
,

newcommandCountBox[1]%
begintikzpicture
node[mynode] (1) 1;
ifnumcomp#1=1%
foreach mynum
[evaluate=mynum as myprev using int(mynum-1)]
in 2,...,#1
node[mynode,xshift=-pgflinewidth,anchor=west] (mynum) at (myprev.east) mynum;
%
endtikzpicture%


begindocument
CountBox1

CountBox3

CountBox6

CountBox2
CountBox4
CountBox7
enddocument


enter image description here






share|improve this answer























  • Thank you for the response! Works like a charm.

    – Phlemp
    Jan 5 at 14:19











  • @Phlemp You're welcome, thank you for accepting my answer!

    – CarLaTeX
    Jan 5 at 16:33















2














With foreach in TikZ:



documentclassarticle 
usepackagetikz
usepackageetoolbox
usetikzlibrary
positioning,
shapes.multipart

tikzset
mynode/.style=
draw,
rectangle split,
rectangle split parts=2,
text centered,
,

newcommandCountBox[1]%
begintikzpicture
node[mynode] (1) 1;
ifnumcomp#1=1%
foreach mynum
[evaluate=mynum as myprev using int(mynum-1)]
in 2,...,#1
node[mynode,xshift=-pgflinewidth,anchor=west] (mynum) at (myprev.east) mynum;
%
endtikzpicture%


begindocument
CountBox1

CountBox3

CountBox6

CountBox2
CountBox4
CountBox7
enddocument


enter image description here






share|improve this answer























  • Thank you for the response! Works like a charm.

    – Phlemp
    Jan 5 at 14:19











  • @Phlemp You're welcome, thank you for accepting my answer!

    – CarLaTeX
    Jan 5 at 16:33













2












2








2







With foreach in TikZ:



documentclassarticle 
usepackagetikz
usepackageetoolbox
usetikzlibrary
positioning,
shapes.multipart

tikzset
mynode/.style=
draw,
rectangle split,
rectangle split parts=2,
text centered,
,

newcommandCountBox[1]%
begintikzpicture
node[mynode] (1) 1;
ifnumcomp#1=1%
foreach mynum
[evaluate=mynum as myprev using int(mynum-1)]
in 2,...,#1
node[mynode,xshift=-pgflinewidth,anchor=west] (mynum) at (myprev.east) mynum;
%
endtikzpicture%


begindocument
CountBox1

CountBox3

CountBox6

CountBox2
CountBox4
CountBox7
enddocument


enter image description here






share|improve this answer













With foreach in TikZ:



documentclassarticle 
usepackagetikz
usepackageetoolbox
usetikzlibrary
positioning,
shapes.multipart

tikzset
mynode/.style=
draw,
rectangle split,
rectangle split parts=2,
text centered,
,

newcommandCountBox[1]%
begintikzpicture
node[mynode] (1) 1;
ifnumcomp#1=1%
foreach mynum
[evaluate=mynum as myprev using int(mynum-1)]
in 2,...,#1
node[mynode,xshift=-pgflinewidth,anchor=west] (mynum) at (myprev.east) mynum;
%
endtikzpicture%


begindocument
CountBox1

CountBox3

CountBox6

CountBox2
CountBox4
CountBox7
enddocument


enter image description here







share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 4 at 21:31









CarLaTeXCarLaTeX

30.3k448127




30.3k448127












  • Thank you for the response! Works like a charm.

    – Phlemp
    Jan 5 at 14:19











  • @Phlemp You're welcome, thank you for accepting my answer!

    – CarLaTeX
    Jan 5 at 16:33

















  • Thank you for the response! Works like a charm.

    – Phlemp
    Jan 5 at 14:19











  • @Phlemp You're welcome, thank you for accepting my answer!

    – CarLaTeX
    Jan 5 at 16:33
















Thank you for the response! Works like a charm.

– Phlemp
Jan 5 at 14:19





Thank you for the response! Works like a charm.

– Phlemp
Jan 5 at 14:19













@Phlemp You're welcome, thank you for accepting my answer!

– CarLaTeX
Jan 5 at 16:33





@Phlemp You're welcome, thank you for accepting my answer!

– CarLaTeX
Jan 5 at 16:33











5














Here is an expl3 implementation. With the help of array and its w column specifier, all columns can be made as wide as the last (with the largest number).



documentclassarticle

usepackagexparse,array

ExplSyntaxOn
NewDocumentCommandCountBoxm

% measure the wider number
hbox_set:Nn l_tmpa_box #1
dim_set:Nn l_tmpa_dim box_wd:N l_tmpa_box
% do as many columns as specified
begintabular*#1
hline
% do '<number> &' one less than specified, then add the last number
int_step_function:nN #1 - 1 __phlemp_countbox_head:n #1 \
hline
% generate as many &'s as necessary to fill the second row
prg_replicate:nn #1 - 1 & \
hline
endtabular


% auxiliary function for adding the & after the number
cs_new_protected:Nn __phlemp_countbox_head:n #1 &
ExplSyntaxOff

begindocument

CountBox3 CountBox10

enddocument


enter image description here






share|improve this answer























  • Thanks for the quick response! It produced a lot of illegal pream-tokens on my side though (working in Overleaf). Also did not allow the _ outside of math-mode, and an undefined control sequence on " int_step_function:nN ". Is that something I can fix or have to install something for? Much appreciated.

    – Phlemp
    Jan 5 at 14:23
















5














Here is an expl3 implementation. With the help of array and its w column specifier, all columns can be made as wide as the last (with the largest number).



documentclassarticle

usepackagexparse,array

ExplSyntaxOn
NewDocumentCommandCountBoxm

% measure the wider number
hbox_set:Nn l_tmpa_box #1
dim_set:Nn l_tmpa_dim box_wd:N l_tmpa_box
% do as many columns as specified
begintabular*#1
hline
% do '<number> &' one less than specified, then add the last number
int_step_function:nN #1 - 1 __phlemp_countbox_head:n #1 \
hline
% generate as many &'s as necessary to fill the second row
prg_replicate:nn #1 - 1 & \
hline
endtabular


% auxiliary function for adding the & after the number
cs_new_protected:Nn __phlemp_countbox_head:n #1 &
ExplSyntaxOff

begindocument

CountBox3 CountBox10

enddocument


enter image description here






share|improve this answer























  • Thanks for the quick response! It produced a lot of illegal pream-tokens on my side though (working in Overleaf). Also did not allow the _ outside of math-mode, and an undefined control sequence on " int_step_function:nN ". Is that something I can fix or have to install something for? Much appreciated.

    – Phlemp
    Jan 5 at 14:23














5












5








5







Here is an expl3 implementation. With the help of array and its w column specifier, all columns can be made as wide as the last (with the largest number).



documentclassarticle

usepackagexparse,array

ExplSyntaxOn
NewDocumentCommandCountBoxm

% measure the wider number
hbox_set:Nn l_tmpa_box #1
dim_set:Nn l_tmpa_dim box_wd:N l_tmpa_box
% do as many columns as specified
begintabular*#1
hline
% do '<number> &' one less than specified, then add the last number
int_step_function:nN #1 - 1 __phlemp_countbox_head:n #1 \
hline
% generate as many &'s as necessary to fill the second row
prg_replicate:nn #1 - 1 & \
hline
endtabular


% auxiliary function for adding the & after the number
cs_new_protected:Nn __phlemp_countbox_head:n #1 &
ExplSyntaxOff

begindocument

CountBox3 CountBox10

enddocument


enter image description here






share|improve this answer













Here is an expl3 implementation. With the help of array and its w column specifier, all columns can be made as wide as the last (with the largest number).



documentclassarticle

usepackagexparse,array

ExplSyntaxOn
NewDocumentCommandCountBoxm

% measure the wider number
hbox_set:Nn l_tmpa_box #1
dim_set:Nn l_tmpa_dim box_wd:N l_tmpa_box
% do as many columns as specified
begintabular*#1
hline
% do '<number> &' one less than specified, then add the last number
int_step_function:nN #1 - 1 __phlemp_countbox_head:n #1 \
hline
% generate as many &'s as necessary to fill the second row
prg_replicate:nn #1 - 1 & \
hline
endtabular


% auxiliary function for adding the & after the number
cs_new_protected:Nn __phlemp_countbox_head:n #1 &
ExplSyntaxOff

begindocument

CountBox3 CountBox10

enddocument


enter image description here







share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 4 at 16:25









egregegreg

713k8618943182




713k8618943182












  • Thanks for the quick response! It produced a lot of illegal pream-tokens on my side though (working in Overleaf). Also did not allow the _ outside of math-mode, and an undefined control sequence on " int_step_function:nN ". Is that something I can fix or have to install something for? Much appreciated.

    – Phlemp
    Jan 5 at 14:23


















  • Thanks for the quick response! It produced a lot of illegal pream-tokens on my side though (working in Overleaf). Also did not allow the _ outside of math-mode, and an undefined control sequence on " int_step_function:nN ". Is that something I can fix or have to install something for? Much appreciated.

    – Phlemp
    Jan 5 at 14:23

















Thanks for the quick response! It produced a lot of illegal pream-tokens on my side though (working in Overleaf). Also did not allow the _ outside of math-mode, and an undefined control sequence on " int_step_function:nN ". Is that something I can fix or have to install something for? Much appreciated.

– Phlemp
Jan 5 at 14:23






Thanks for the quick response! It produced a lot of illegal pream-tokens on my side though (working in Overleaf). Also did not allow the _ outside of math-mode, and an undefined control sequence on " int_step_function:nN ". Is that something I can fix or have to install something for? Much appreciated.

– Phlemp
Jan 5 at 14:23












3














The following uses multido to generate the column numbering sequence and blank row. A similar approach to egreg's uses array's w<align><width> to set the column width to the widest element:



enter image description here



documentclassarticle

usepackagemultido,array

newcounterboxCount
newlengthboxCountwd

makeatletter
newcommandCountBox[1]%
setcounterboxCount0% Reset boxCount
settowidthboxCountwd#1% Measure widest element
defCountBoxSeq@gobble%
defCountBoxSeqPhantom@gobble%
multidoi=1+1#1%
xdefCountBoxSeqCountBoxSeq & i%
xdefCountBoxSeqPhantomCountBoxSeqPhantom &%
%
noindent
begintabular *#1
hline
CountBoxSeq \
hline
CountBoxSeqPhantom \
hline
endtabular%

makeatother

begindocument

CountBox5

enddocument





share|improve this answer























  • Thanks for the reply! When I try compiling it produces illegal pream tokens on the "w" and on the "boxCountwd" in the tabular. I don't know how to fix it. Working in Overleaf. Really appreciate your help!

    – Phlemp
    Jan 5 at 14:25












  • @Phlemp: Did you add usepackagearray to your preamble like I did? Probably not. You don't have to use wc.. as a column specification. It just aids in making the column widths the same if you have 10 or more columns. Alternatively, just use c, l or r.

    – Werner
    Jan 5 at 17:22















3














The following uses multido to generate the column numbering sequence and blank row. A similar approach to egreg's uses array's w<align><width> to set the column width to the widest element:



enter image description here



documentclassarticle

usepackagemultido,array

newcounterboxCount
newlengthboxCountwd

makeatletter
newcommandCountBox[1]%
setcounterboxCount0% Reset boxCount
settowidthboxCountwd#1% Measure widest element
defCountBoxSeq@gobble%
defCountBoxSeqPhantom@gobble%
multidoi=1+1#1%
xdefCountBoxSeqCountBoxSeq & i%
xdefCountBoxSeqPhantomCountBoxSeqPhantom &%
%
noindent
begintabular *#1
hline
CountBoxSeq \
hline
CountBoxSeqPhantom \
hline
endtabular%

makeatother

begindocument

CountBox5

enddocument





share|improve this answer























  • Thanks for the reply! When I try compiling it produces illegal pream tokens on the "w" and on the "boxCountwd" in the tabular. I don't know how to fix it. Working in Overleaf. Really appreciate your help!

    – Phlemp
    Jan 5 at 14:25












  • @Phlemp: Did you add usepackagearray to your preamble like I did? Probably not. You don't have to use wc.. as a column specification. It just aids in making the column widths the same if you have 10 or more columns. Alternatively, just use c, l or r.

    – Werner
    Jan 5 at 17:22













3












3








3







The following uses multido to generate the column numbering sequence and blank row. A similar approach to egreg's uses array's w<align><width> to set the column width to the widest element:



enter image description here



documentclassarticle

usepackagemultido,array

newcounterboxCount
newlengthboxCountwd

makeatletter
newcommandCountBox[1]%
setcounterboxCount0% Reset boxCount
settowidthboxCountwd#1% Measure widest element
defCountBoxSeq@gobble%
defCountBoxSeqPhantom@gobble%
multidoi=1+1#1%
xdefCountBoxSeqCountBoxSeq & i%
xdefCountBoxSeqPhantomCountBoxSeqPhantom &%
%
noindent
begintabular *#1
hline
CountBoxSeq \
hline
CountBoxSeqPhantom \
hline
endtabular%

makeatother

begindocument

CountBox5

enddocument





share|improve this answer













The following uses multido to generate the column numbering sequence and blank row. A similar approach to egreg's uses array's w<align><width> to set the column width to the widest element:



enter image description here



documentclassarticle

usepackagemultido,array

newcounterboxCount
newlengthboxCountwd

makeatletter
newcommandCountBox[1]%
setcounterboxCount0% Reset boxCount
settowidthboxCountwd#1% Measure widest element
defCountBoxSeq@gobble%
defCountBoxSeqPhantom@gobble%
multidoi=1+1#1%
xdefCountBoxSeqCountBoxSeq & i%
xdefCountBoxSeqPhantomCountBoxSeqPhantom &%
%
noindent
begintabular *#1
hline
CountBoxSeq \
hline
CountBoxSeqPhantom \
hline
endtabular%

makeatother

begindocument

CountBox5

enddocument






share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 4 at 16:34









WernerWerner

440k669681662




440k669681662












  • Thanks for the reply! When I try compiling it produces illegal pream tokens on the "w" and on the "boxCountwd" in the tabular. I don't know how to fix it. Working in Overleaf. Really appreciate your help!

    – Phlemp
    Jan 5 at 14:25












  • @Phlemp: Did you add usepackagearray to your preamble like I did? Probably not. You don't have to use wc.. as a column specification. It just aids in making the column widths the same if you have 10 or more columns. Alternatively, just use c, l or r.

    – Werner
    Jan 5 at 17:22

















  • Thanks for the reply! When I try compiling it produces illegal pream tokens on the "w" and on the "boxCountwd" in the tabular. I don't know how to fix it. Working in Overleaf. Really appreciate your help!

    – Phlemp
    Jan 5 at 14:25












  • @Phlemp: Did you add usepackagearray to your preamble like I did? Probably not. You don't have to use wc.. as a column specification. It just aids in making the column widths the same if you have 10 or more columns. Alternatively, just use c, l or r.

    – Werner
    Jan 5 at 17:22
















Thanks for the reply! When I try compiling it produces illegal pream tokens on the "w" and on the "boxCountwd" in the tabular. I don't know how to fix it. Working in Overleaf. Really appreciate your help!

– Phlemp
Jan 5 at 14:25






Thanks for the reply! When I try compiling it produces illegal pream tokens on the "w" and on the "boxCountwd" in the tabular. I don't know how to fix it. Working in Overleaf. Really appreciate your help!

– Phlemp
Jan 5 at 14:25














@Phlemp: Did you add usepackagearray to your preamble like I did? Probably not. You don't have to use wc.. as a column specification. It just aids in making the column widths the same if you have 10 or more columns. Alternatively, just use c, l or r.

– Werner
Jan 5 at 17:22





@Phlemp: Did you add usepackagearray to your preamble like I did? Probably not. You don't have to use wc.. as a column specification. It just aids in making the column widths the same if you have 10 or more columns. Alternatively, just use c, l or r.

– Werner
Jan 5 at 17:22

















draft saved

draft discarded
















































Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f468575%2fautomatic-amount-table-columns-and-column-numbers%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown






Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay