How to use the TableText commando to create a table from a spredsheet with a variable number of rows

M.E shared this question 1 year ago
Answered

I would like to create a table from cell content in the spreadsheet with a variable number of rows by using the TableText command.

How can I do that ?

Comments (18)

photo
1

attached a sample

photo
1

Thanks.

Sorry, I see I should have read this a bit more carefully in relation to how to place rows and columns in the command: https://wiki.geogebra.org/e...

Is it possible to use the command to have one column where the content is left aligned, while the rest of the columns are centered ?

Or how can I make that ?

photo
1

see attachment

photo
1

your first example is easier with TableText({A1:A200, B1:B200, C1:C200}, "vcrl")

photo
1

Thank you both. :)

It's quite smart so easy it is.

"v" stands for that every element of the list (for example "A1:A200", "B1:B200" and "C1:C200") is a column.

I see the last three letters stands for the alignment of the content in each column in the listed order of the columns.

The letter "c" stands for centered, "r" for right and "l" for left alignment.

And if one would like to have the table with all borders showed, then the command will be:

TableText[ { A1:A200, B1:B200, C1:C200 }, "|_vcrl" ]

Be aware that this "|" is not a letter, but instead a symbol.

"|" stands for showed borders to the left and right of every column. And "_" stands for showed borders above and below each row.

photo
1

Moved below.

photo
photo
1

What if I would like to have a table where all the cells in the table should be aligned centered except B2:B11 which should be aligned left. Meaning that the first cell in the B column (which contain a category) also should be centered.

So my question is: How can I get the first cell in a column to have another alignment than the rest of the cells in the same column ?

photo
1

doing two tables and combining in one table like rami did

photo
1

Yes, but how to handle the different width of the first cell in every column and the other cells in the column.

For example see the image below.

4f1c0fedde2c10f9d6cb9d05e27057a5

photo
1

Maybe one way could be to shift from v to h so that the alignment is controlled by each row instead of each column. But then I don't know how to make the table with a variable number of rows.

photo
1

Arh, I forgot that it isn't possible to get the cells in the range B2:B10 aligned left at the same time.

So the first row has to be created as an object for itself. And somehow combined with the others so that all the cells in each column has the same width.

photo
1

I can't find a way to do it... :(

photo
1

you can try spaces or phantom in 1,2 position for centering the first label onlyand clcc for each column

https://wiki.geogebra.org/e...

photo
1

What is a "phantom" - could you insert the symbol

Sorry, I'm not sure how the script should be for this: "try spaces or phantom in 1,2 position for centering the first label only and clcc for each column." Could you write an example of a script here.

Thank you, for the link. I missed much of it earlier. But it is still very useful.

But sorry, I still can't see how to make a table according to my requirements. On the page they only describes how to make other or more simplified kind of tables. Either multi-column or tables where all cells in a column have the same alignment.

photo
1

What is a "phantom" 

read the link


más no puedo hacer

photo
1

Thanks.

It's a low practical way to do it, but it works/does the job, so it's okay. :)

photo
photo
1

try in LAtex


\begin{array}{|r|l|c|}

\hline

\multicolumn{1}{|c|}{Titldfdfdfde} \multicolumn{1}{c|}{gggggklkje}{sfsdf}\\

\hline

xjhgjhgjhgnbvnbvnbjhgjh & yjhgjhgjhgjhgjhgjhgjhgjhgjhghjhmnh&jhjhgjhgjhgjhgjhgjhgjhgjhgjhgjhgjhg\\

\hline

amnbnvnbv & bhgjhgjhgj&hg\\

c & cjjgjhgjhgjhgjhgjh&gjhg\\

d & e\\ \hline

\end{array}

https://www.geogebra.org/m/RC7Pnnk5

photo
1

Yes, that is a better way to do it. :)

Than you very much for your time and effort ! :)

And thank you for the link.

photo
© 2019 International GeoGebra Institute