Assume I have a table with a dynamic number of rows and columns, and I want to fill the table with n elements. Assume an element has the constant length x, and I want to say make floor(linewitdth/x) columns per row so that the maximal number of elements is in a row. How would I write that in LaTeX?
Asked
Active
Viewed 175 times
5
1 Answers
3
If your elements all have the same width x (either naturally or because you put each one in a \makebox[3cm][l]{.....} ) then you don't need a table construct or to do any arithmetic, just place them one after another in a flushleft environment and the paragraph breaker will naturally fit as many as it can on each line, and vertical alignment is automatic.
See this technique being used
or
David Carlisle
- 757,742
-
ok, this looks promisingg, last stupid question - for a given string x, how do i determine the width and put it in your formula? – Twerp Aug 24 '12 at 09:55
csvfile? I think the packagedatatoolwill be the best choice. – Marco Daniel Aug 23 '12 at 18:49