Self reflowing tables on the whole page











up vote
0
down vote

favorite












I need to reproduce the following 2 layouts ( in landscape, if that matters ) involving just and only tables :



enter image description here



The first layout is just 1 long table that spans from the upper left to the bottom right corner, the entries of the table should auto-fit themselves for the right amount of vertical space . The important thing is that the entire page is being used .



The second problem is about the same but instead of having just 1 table I have more tables; and all the tables still need to auto-adjust together from the upper left corner to the bottom right one, but I would also like to tune the vertical spacing between each single table ( red space in the picture ) and the entries of each table should auto-fit the vertical space according to the space left by my adjustments .



I gave a rapid overview to the manual / docs / pdf of the tabularx package but I don't think it says anything about this kind of alignment and fitting so I'm looking for solutions and suggestions .



Note that I don't need anything else apart from the tabular data itself on this document, I don't need a title or other components of the documents ( footnotes, page numbers, etc etc ) , I can use the entire page just for the tables .



Thanks for the help .










share|improve this question


















  • 1




    Welcome to TeX.SX! Are you really talking about tables here or simply some layout elements? It would be helpful to (a) have some examples of the content and (b) see what you have tried so far. Maybe a package like tcolorbox with its tcbposter library could help you which provides very good "reflowing" facilities.
    – TeXnician
    Aug 19 at 14:19










  • @TeXnician Thank you for the reply . I don't need any "extra" element like colors or lines, I just need to print tabular data that has 3-4 columns for each entry : a really minimal and simple layout . My problem is just about the alignment and find the right commands to keep the table on the whole page . Each entry in each column has small words and maybe small numerical values, nothing fancy .
    – user168698
    Aug 19 at 14:26








  • 2




    this remain me on four column document (like journal). i would not use table for this. just plain document.
    – Zarko
    Aug 19 at 14:28










  • @Zarko can you show an example ?
    – user168698
    Aug 19 at 14:29










  • Have a look at the multicol package.
    – TeXnician
    Aug 19 at 14:33

















up vote
0
down vote

favorite












I need to reproduce the following 2 layouts ( in landscape, if that matters ) involving just and only tables :



enter image description here



The first layout is just 1 long table that spans from the upper left to the bottom right corner, the entries of the table should auto-fit themselves for the right amount of vertical space . The important thing is that the entire page is being used .



The second problem is about the same but instead of having just 1 table I have more tables; and all the tables still need to auto-adjust together from the upper left corner to the bottom right one, but I would also like to tune the vertical spacing between each single table ( red space in the picture ) and the entries of each table should auto-fit the vertical space according to the space left by my adjustments .



I gave a rapid overview to the manual / docs / pdf of the tabularx package but I don't think it says anything about this kind of alignment and fitting so I'm looking for solutions and suggestions .



Note that I don't need anything else apart from the tabular data itself on this document, I don't need a title or other components of the documents ( footnotes, page numbers, etc etc ) , I can use the entire page just for the tables .



Thanks for the help .










share|improve this question


















  • 1




    Welcome to TeX.SX! Are you really talking about tables here or simply some layout elements? It would be helpful to (a) have some examples of the content and (b) see what you have tried so far. Maybe a package like tcolorbox with its tcbposter library could help you which provides very good "reflowing" facilities.
    – TeXnician
    Aug 19 at 14:19










  • @TeXnician Thank you for the reply . I don't need any "extra" element like colors or lines, I just need to print tabular data that has 3-4 columns for each entry : a really minimal and simple layout . My problem is just about the alignment and find the right commands to keep the table on the whole page . Each entry in each column has small words and maybe small numerical values, nothing fancy .
    – user168698
    Aug 19 at 14:26








  • 2




    this remain me on four column document (like journal). i would not use table for this. just plain document.
    – Zarko
    Aug 19 at 14:28










  • @Zarko can you show an example ?
    – user168698
    Aug 19 at 14:29










  • Have a look at the multicol package.
    – TeXnician
    Aug 19 at 14:33















up vote
0
down vote

favorite









up vote
0
down vote

favorite











I need to reproduce the following 2 layouts ( in landscape, if that matters ) involving just and only tables :



enter image description here



The first layout is just 1 long table that spans from the upper left to the bottom right corner, the entries of the table should auto-fit themselves for the right amount of vertical space . The important thing is that the entire page is being used .



The second problem is about the same but instead of having just 1 table I have more tables; and all the tables still need to auto-adjust together from the upper left corner to the bottom right one, but I would also like to tune the vertical spacing between each single table ( red space in the picture ) and the entries of each table should auto-fit the vertical space according to the space left by my adjustments .



I gave a rapid overview to the manual / docs / pdf of the tabularx package but I don't think it says anything about this kind of alignment and fitting so I'm looking for solutions and suggestions .



Note that I don't need anything else apart from the tabular data itself on this document, I don't need a title or other components of the documents ( footnotes, page numbers, etc etc ) , I can use the entire page just for the tables .



Thanks for the help .










share|improve this question













I need to reproduce the following 2 layouts ( in landscape, if that matters ) involving just and only tables :



enter image description here



The first layout is just 1 long table that spans from the upper left to the bottom right corner, the entries of the table should auto-fit themselves for the right amount of vertical space . The important thing is that the entire page is being used .



The second problem is about the same but instead of having just 1 table I have more tables; and all the tables still need to auto-adjust together from the upper left corner to the bottom right one, but I would also like to tune the vertical spacing between each single table ( red space in the picture ) and the entries of each table should auto-fit the vertical space according to the space left by my adjustments .



I gave a rapid overview to the manual / docs / pdf of the tabularx package but I don't think it says anything about this kind of alignment and fitting so I'm looking for solutions and suggestions .



Note that I don't need anything else apart from the tabular data itself on this document, I don't need a title or other components of the documents ( footnotes, page numbers, etc etc ) , I can use the entire page just for the tables .



Thanks for the help .







tables






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Aug 19 at 13:47









user168698

11




11








  • 1




    Welcome to TeX.SX! Are you really talking about tables here or simply some layout elements? It would be helpful to (a) have some examples of the content and (b) see what you have tried so far. Maybe a package like tcolorbox with its tcbposter library could help you which provides very good "reflowing" facilities.
    – TeXnician
    Aug 19 at 14:19










  • @TeXnician Thank you for the reply . I don't need any "extra" element like colors or lines, I just need to print tabular data that has 3-4 columns for each entry : a really minimal and simple layout . My problem is just about the alignment and find the right commands to keep the table on the whole page . Each entry in each column has small words and maybe small numerical values, nothing fancy .
    – user168698
    Aug 19 at 14:26








  • 2




    this remain me on four column document (like journal). i would not use table for this. just plain document.
    – Zarko
    Aug 19 at 14:28










  • @Zarko can you show an example ?
    – user168698
    Aug 19 at 14:29










  • Have a look at the multicol package.
    – TeXnician
    Aug 19 at 14:33
















  • 1




    Welcome to TeX.SX! Are you really talking about tables here or simply some layout elements? It would be helpful to (a) have some examples of the content and (b) see what you have tried so far. Maybe a package like tcolorbox with its tcbposter library could help you which provides very good "reflowing" facilities.
    – TeXnician
    Aug 19 at 14:19










  • @TeXnician Thank you for the reply . I don't need any "extra" element like colors or lines, I just need to print tabular data that has 3-4 columns for each entry : a really minimal and simple layout . My problem is just about the alignment and find the right commands to keep the table on the whole page . Each entry in each column has small words and maybe small numerical values, nothing fancy .
    – user168698
    Aug 19 at 14:26








  • 2




    this remain me on four column document (like journal). i would not use table for this. just plain document.
    – Zarko
    Aug 19 at 14:28










  • @Zarko can you show an example ?
    – user168698
    Aug 19 at 14:29










  • Have a look at the multicol package.
    – TeXnician
    Aug 19 at 14:33










1




1




Welcome to TeX.SX! Are you really talking about tables here or simply some layout elements? It would be helpful to (a) have some examples of the content and (b) see what you have tried so far. Maybe a package like tcolorbox with its tcbposter library could help you which provides very good "reflowing" facilities.
– TeXnician
Aug 19 at 14:19




Welcome to TeX.SX! Are you really talking about tables here or simply some layout elements? It would be helpful to (a) have some examples of the content and (b) see what you have tried so far. Maybe a package like tcolorbox with its tcbposter library could help you which provides very good "reflowing" facilities.
– TeXnician
Aug 19 at 14:19












@TeXnician Thank you for the reply . I don't need any "extra" element like colors or lines, I just need to print tabular data that has 3-4 columns for each entry : a really minimal and simple layout . My problem is just about the alignment and find the right commands to keep the table on the whole page . Each entry in each column has small words and maybe small numerical values, nothing fancy .
– user168698
Aug 19 at 14:26






@TeXnician Thank you for the reply . I don't need any "extra" element like colors or lines, I just need to print tabular data that has 3-4 columns for each entry : a really minimal and simple layout . My problem is just about the alignment and find the right commands to keep the table on the whole page . Each entry in each column has small words and maybe small numerical values, nothing fancy .
– user168698
Aug 19 at 14:26






2




2




this remain me on four column document (like journal). i would not use table for this. just plain document.
– Zarko
Aug 19 at 14:28




this remain me on four column document (like journal). i would not use table for this. just plain document.
– Zarko
Aug 19 at 14:28












@Zarko can you show an example ?
– user168698
Aug 19 at 14:29




@Zarko can you show an example ?
– user168698
Aug 19 at 14:29












Have a look at the multicol package.
– TeXnician
Aug 19 at 14:33






Have a look at the multicol package.
– TeXnician
Aug 19 at 14:33












1 Answer
1






active

oldest

votes

















up vote
0
down vote













Rather than using tables for this I would define a custom pics using tikz -- you can read all about pics in section 18.2 of the tikz manual (version 3.0.1a) -- and I'd then wrap everything into a custom macro so that the commands



GrayTable{1,1,1,1}
newpage

RedTable{0.8,0.1,0.4,0.3}


would produce the two pages



enter image description here



The numbers in the comma separated list given to GrayTable become the numbers printed in the table. In the RedTable macro, the numbers give the "relative" height of the line in each column and the numbers in the table cells are automatically generated as in the MWE.



Using tikzpagenodes I have made the table fill the full "text area" of the page. There would probably be printing issues, but you could make the table fill the entire page by replacing all occurrences of current page header area with current page.



In fact, the macros below are slightly more general in that, within reason, they are not restricted to four columns and in exactly the same way produce (see the second example in the MWE below):



enter image description here



Here is the full code:



documentclass[svgnames]{article}
usepackage[a4paper, landscape]{geometry}
usepackage{tikz}
usetikzlibrary{calc}
usepackage{tikzpagenodes}

tikzset{
gray cell/.style = {
rectangle,
fill=SlateGray,
draw=LightGray,
line width=2mm,
anchor=north west,
minimum height=textheight,
font=Huge
},
pics/gray cells/.style args = {#1}{
code = {
% count the number of columns
foreach x [count=c, remember=c as C] in {#1} {};
foreach x [count=c, evaluate=c as r using {c/C}] in {#1} {
node[gray cell, minimum width=textwidth/C] at
($ (current page header area.north west)!r!(current page header area.north east) $)
{x};
}
}
},
gray line/.style = {
fill=LightGray,
draw=LightGray,
},
red line/.style = {
fill=Red,
draw=Red,
},
pics/red cells/.style args = {#1}{
code = {
% count the number of columns

foreach cell [count=c, remember=c as C] in {#1} {};
foreach x [count=c, evaluate=c as r using {c/C},
evaluate=c as d using {int(c+1)}] in {#1} {
node[gray cell, minimum width=textwidth/C] (RCc) at
($ (current page header area.north west)!r!(current page header area.north east) $){};
coordinate (RCLc) at ($ (RCc.north west)!x!(RCc.south west)+(0,1mm) $);
coordinate (RCRc) at ($ (RCc.north east)!x!(RCc.south east)-(0,1mm) $);
draw[gray line] (RCLc) rectangle (RCRc);
draw[red line] ($ (RCLc)+(8mm,0) $) rectangle ($ (RCRc)-(8mm,0) $);
node[font=Huge] at ($ (-0.8,0.8) + (RCRc.north east) $) {c};
node[font=Huge] at ($ (-0.8,0.8) + (RCc.south east) $) {d};
}
}
}
}

newcommandGrayTable[1]{tikz{pic at (0,0) {gray cells={#1}};}}
newcommandRedTable[1]{tikz{pic at (0,0) {red cells={#1}};}}

pagestyle{empty}
begin{document}

GrayTable{1,1,1,1}
newpage

RedTable{0.8,0.1,0.4,0.3}
newpage

GrayTable{1,2,3,4,5,6}
newpage

RedTable{0.8,0.1,0.5,0.7,0.4,0.3}

end{document}





share|improve this answer





















  • I don't think this is what the question is about. I believe it's about typesetting actual tabular data, spanning across pages.
    – Henri Menke
    Sep 19 at 2:03











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',
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%2f446671%2fself-reflowing-tables-on-the-whole-page%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













Rather than using tables for this I would define a custom pics using tikz -- you can read all about pics in section 18.2 of the tikz manual (version 3.0.1a) -- and I'd then wrap everything into a custom macro so that the commands



GrayTable{1,1,1,1}
newpage

RedTable{0.8,0.1,0.4,0.3}


would produce the two pages



enter image description here



The numbers in the comma separated list given to GrayTable become the numbers printed in the table. In the RedTable macro, the numbers give the "relative" height of the line in each column and the numbers in the table cells are automatically generated as in the MWE.



Using tikzpagenodes I have made the table fill the full "text area" of the page. There would probably be printing issues, but you could make the table fill the entire page by replacing all occurrences of current page header area with current page.



In fact, the macros below are slightly more general in that, within reason, they are not restricted to four columns and in exactly the same way produce (see the second example in the MWE below):



enter image description here



Here is the full code:



documentclass[svgnames]{article}
usepackage[a4paper, landscape]{geometry}
usepackage{tikz}
usetikzlibrary{calc}
usepackage{tikzpagenodes}

tikzset{
gray cell/.style = {
rectangle,
fill=SlateGray,
draw=LightGray,
line width=2mm,
anchor=north west,
minimum height=textheight,
font=Huge
},
pics/gray cells/.style args = {#1}{
code = {
% count the number of columns
foreach x [count=c, remember=c as C] in {#1} {};
foreach x [count=c, evaluate=c as r using {c/C}] in {#1} {
node[gray cell, minimum width=textwidth/C] at
($ (current page header area.north west)!r!(current page header area.north east) $)
{x};
}
}
},
gray line/.style = {
fill=LightGray,
draw=LightGray,
},
red line/.style = {
fill=Red,
draw=Red,
},
pics/red cells/.style args = {#1}{
code = {
% count the number of columns

foreach cell [count=c, remember=c as C] in {#1} {};
foreach x [count=c, evaluate=c as r using {c/C},
evaluate=c as d using {int(c+1)}] in {#1} {
node[gray cell, minimum width=textwidth/C] (RCc) at
($ (current page header area.north west)!r!(current page header area.north east) $){};
coordinate (RCLc) at ($ (RCc.north west)!x!(RCc.south west)+(0,1mm) $);
coordinate (RCRc) at ($ (RCc.north east)!x!(RCc.south east)-(0,1mm) $);
draw[gray line] (RCLc) rectangle (RCRc);
draw[red line] ($ (RCLc)+(8mm,0) $) rectangle ($ (RCRc)-(8mm,0) $);
node[font=Huge] at ($ (-0.8,0.8) + (RCRc.north east) $) {c};
node[font=Huge] at ($ (-0.8,0.8) + (RCc.south east) $) {d};
}
}
}
}

newcommandGrayTable[1]{tikz{pic at (0,0) {gray cells={#1}};}}
newcommandRedTable[1]{tikz{pic at (0,0) {red cells={#1}};}}

pagestyle{empty}
begin{document}

GrayTable{1,1,1,1}
newpage

RedTable{0.8,0.1,0.4,0.3}
newpage

GrayTable{1,2,3,4,5,6}
newpage

RedTable{0.8,0.1,0.5,0.7,0.4,0.3}

end{document}





share|improve this answer





















  • I don't think this is what the question is about. I believe it's about typesetting actual tabular data, spanning across pages.
    – Henri Menke
    Sep 19 at 2:03















up vote
0
down vote













Rather than using tables for this I would define a custom pics using tikz -- you can read all about pics in section 18.2 of the tikz manual (version 3.0.1a) -- and I'd then wrap everything into a custom macro so that the commands



GrayTable{1,1,1,1}
newpage

RedTable{0.8,0.1,0.4,0.3}


would produce the two pages



enter image description here



The numbers in the comma separated list given to GrayTable become the numbers printed in the table. In the RedTable macro, the numbers give the "relative" height of the line in each column and the numbers in the table cells are automatically generated as in the MWE.



Using tikzpagenodes I have made the table fill the full "text area" of the page. There would probably be printing issues, but you could make the table fill the entire page by replacing all occurrences of current page header area with current page.



In fact, the macros below are slightly more general in that, within reason, they are not restricted to four columns and in exactly the same way produce (see the second example in the MWE below):



enter image description here



Here is the full code:



documentclass[svgnames]{article}
usepackage[a4paper, landscape]{geometry}
usepackage{tikz}
usetikzlibrary{calc}
usepackage{tikzpagenodes}

tikzset{
gray cell/.style = {
rectangle,
fill=SlateGray,
draw=LightGray,
line width=2mm,
anchor=north west,
minimum height=textheight,
font=Huge
},
pics/gray cells/.style args = {#1}{
code = {
% count the number of columns
foreach x [count=c, remember=c as C] in {#1} {};
foreach x [count=c, evaluate=c as r using {c/C}] in {#1} {
node[gray cell, minimum width=textwidth/C] at
($ (current page header area.north west)!r!(current page header area.north east) $)
{x};
}
}
},
gray line/.style = {
fill=LightGray,
draw=LightGray,
},
red line/.style = {
fill=Red,
draw=Red,
},
pics/red cells/.style args = {#1}{
code = {
% count the number of columns

foreach cell [count=c, remember=c as C] in {#1} {};
foreach x [count=c, evaluate=c as r using {c/C},
evaluate=c as d using {int(c+1)}] in {#1} {
node[gray cell, minimum width=textwidth/C] (RCc) at
($ (current page header area.north west)!r!(current page header area.north east) $){};
coordinate (RCLc) at ($ (RCc.north west)!x!(RCc.south west)+(0,1mm) $);
coordinate (RCRc) at ($ (RCc.north east)!x!(RCc.south east)-(0,1mm) $);
draw[gray line] (RCLc) rectangle (RCRc);
draw[red line] ($ (RCLc)+(8mm,0) $) rectangle ($ (RCRc)-(8mm,0) $);
node[font=Huge] at ($ (-0.8,0.8) + (RCRc.north east) $) {c};
node[font=Huge] at ($ (-0.8,0.8) + (RCc.south east) $) {d};
}
}
}
}

newcommandGrayTable[1]{tikz{pic at (0,0) {gray cells={#1}};}}
newcommandRedTable[1]{tikz{pic at (0,0) {red cells={#1}};}}

pagestyle{empty}
begin{document}

GrayTable{1,1,1,1}
newpage

RedTable{0.8,0.1,0.4,0.3}
newpage

GrayTable{1,2,3,4,5,6}
newpage

RedTable{0.8,0.1,0.5,0.7,0.4,0.3}

end{document}





share|improve this answer





















  • I don't think this is what the question is about. I believe it's about typesetting actual tabular data, spanning across pages.
    – Henri Menke
    Sep 19 at 2:03













up vote
0
down vote










up vote
0
down vote









Rather than using tables for this I would define a custom pics using tikz -- you can read all about pics in section 18.2 of the tikz manual (version 3.0.1a) -- and I'd then wrap everything into a custom macro so that the commands



GrayTable{1,1,1,1}
newpage

RedTable{0.8,0.1,0.4,0.3}


would produce the two pages



enter image description here



The numbers in the comma separated list given to GrayTable become the numbers printed in the table. In the RedTable macro, the numbers give the "relative" height of the line in each column and the numbers in the table cells are automatically generated as in the MWE.



Using tikzpagenodes I have made the table fill the full "text area" of the page. There would probably be printing issues, but you could make the table fill the entire page by replacing all occurrences of current page header area with current page.



In fact, the macros below are slightly more general in that, within reason, they are not restricted to four columns and in exactly the same way produce (see the second example in the MWE below):



enter image description here



Here is the full code:



documentclass[svgnames]{article}
usepackage[a4paper, landscape]{geometry}
usepackage{tikz}
usetikzlibrary{calc}
usepackage{tikzpagenodes}

tikzset{
gray cell/.style = {
rectangle,
fill=SlateGray,
draw=LightGray,
line width=2mm,
anchor=north west,
minimum height=textheight,
font=Huge
},
pics/gray cells/.style args = {#1}{
code = {
% count the number of columns
foreach x [count=c, remember=c as C] in {#1} {};
foreach x [count=c, evaluate=c as r using {c/C}] in {#1} {
node[gray cell, minimum width=textwidth/C] at
($ (current page header area.north west)!r!(current page header area.north east) $)
{x};
}
}
},
gray line/.style = {
fill=LightGray,
draw=LightGray,
},
red line/.style = {
fill=Red,
draw=Red,
},
pics/red cells/.style args = {#1}{
code = {
% count the number of columns

foreach cell [count=c, remember=c as C] in {#1} {};
foreach x [count=c, evaluate=c as r using {c/C},
evaluate=c as d using {int(c+1)}] in {#1} {
node[gray cell, minimum width=textwidth/C] (RCc) at
($ (current page header area.north west)!r!(current page header area.north east) $){};
coordinate (RCLc) at ($ (RCc.north west)!x!(RCc.south west)+(0,1mm) $);
coordinate (RCRc) at ($ (RCc.north east)!x!(RCc.south east)-(0,1mm) $);
draw[gray line] (RCLc) rectangle (RCRc);
draw[red line] ($ (RCLc)+(8mm,0) $) rectangle ($ (RCRc)-(8mm,0) $);
node[font=Huge] at ($ (-0.8,0.8) + (RCRc.north east) $) {c};
node[font=Huge] at ($ (-0.8,0.8) + (RCc.south east) $) {d};
}
}
}
}

newcommandGrayTable[1]{tikz{pic at (0,0) {gray cells={#1}};}}
newcommandRedTable[1]{tikz{pic at (0,0) {red cells={#1}};}}

pagestyle{empty}
begin{document}

GrayTable{1,1,1,1}
newpage

RedTable{0.8,0.1,0.4,0.3}
newpage

GrayTable{1,2,3,4,5,6}
newpage

RedTable{0.8,0.1,0.5,0.7,0.4,0.3}

end{document}





share|improve this answer












Rather than using tables for this I would define a custom pics using tikz -- you can read all about pics in section 18.2 of the tikz manual (version 3.0.1a) -- and I'd then wrap everything into a custom macro so that the commands



GrayTable{1,1,1,1}
newpage

RedTable{0.8,0.1,0.4,0.3}


would produce the two pages



enter image description here



The numbers in the comma separated list given to GrayTable become the numbers printed in the table. In the RedTable macro, the numbers give the "relative" height of the line in each column and the numbers in the table cells are automatically generated as in the MWE.



Using tikzpagenodes I have made the table fill the full "text area" of the page. There would probably be printing issues, but you could make the table fill the entire page by replacing all occurrences of current page header area with current page.



In fact, the macros below are slightly more general in that, within reason, they are not restricted to four columns and in exactly the same way produce (see the second example in the MWE below):



enter image description here



Here is the full code:



documentclass[svgnames]{article}
usepackage[a4paper, landscape]{geometry}
usepackage{tikz}
usetikzlibrary{calc}
usepackage{tikzpagenodes}

tikzset{
gray cell/.style = {
rectangle,
fill=SlateGray,
draw=LightGray,
line width=2mm,
anchor=north west,
minimum height=textheight,
font=Huge
},
pics/gray cells/.style args = {#1}{
code = {
% count the number of columns
foreach x [count=c, remember=c as C] in {#1} {};
foreach x [count=c, evaluate=c as r using {c/C}] in {#1} {
node[gray cell, minimum width=textwidth/C] at
($ (current page header area.north west)!r!(current page header area.north east) $)
{x};
}
}
},
gray line/.style = {
fill=LightGray,
draw=LightGray,
},
red line/.style = {
fill=Red,
draw=Red,
},
pics/red cells/.style args = {#1}{
code = {
% count the number of columns

foreach cell [count=c, remember=c as C] in {#1} {};
foreach x [count=c, evaluate=c as r using {c/C},
evaluate=c as d using {int(c+1)}] in {#1} {
node[gray cell, minimum width=textwidth/C] (RCc) at
($ (current page header area.north west)!r!(current page header area.north east) $){};
coordinate (RCLc) at ($ (RCc.north west)!x!(RCc.south west)+(0,1mm) $);
coordinate (RCRc) at ($ (RCc.north east)!x!(RCc.south east)-(0,1mm) $);
draw[gray line] (RCLc) rectangle (RCRc);
draw[red line] ($ (RCLc)+(8mm,0) $) rectangle ($ (RCRc)-(8mm,0) $);
node[font=Huge] at ($ (-0.8,0.8) + (RCRc.north east) $) {c};
node[font=Huge] at ($ (-0.8,0.8) + (RCc.south east) $) {d};
}
}
}
}

newcommandGrayTable[1]{tikz{pic at (0,0) {gray cells={#1}};}}
newcommandRedTable[1]{tikz{pic at (0,0) {red cells={#1}};}}

pagestyle{empty}
begin{document}

GrayTable{1,1,1,1}
newpage

RedTable{0.8,0.1,0.4,0.3}
newpage

GrayTable{1,2,3,4,5,6}
newpage

RedTable{0.8,0.1,0.5,0.7,0.4,0.3}

end{document}






share|improve this answer












share|improve this answer



share|improve this answer










answered Aug 20 at 1:20









Andrew

29.3k34178




29.3k34178












  • I don't think this is what the question is about. I believe it's about typesetting actual tabular data, spanning across pages.
    – Henri Menke
    Sep 19 at 2:03


















  • I don't think this is what the question is about. I believe it's about typesetting actual tabular data, spanning across pages.
    – Henri Menke
    Sep 19 at 2:03
















I don't think this is what the question is about. I believe it's about typesetting actual tabular data, spanning across pages.
– Henri Menke
Sep 19 at 2:03




I don't think this is what the question is about. I believe it's about typesetting actual tabular data, spanning across pages.
– Henri Menke
Sep 19 at 2:03


















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f446671%2fself-reflowing-tables-on-the-whole-page%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 send String Array data to Server using php in android

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

Is anime1.com a legal site for watching anime?