# Need help with learning TTable in pyROOT

**URL:** <https://root-forum.cern.ch/t/need-help-with-learning-ttable-in-pyroot/63917>\
**Category:** Newbie\
**Tags:** python, root\
**Created:** [July 18, 2025, 7:19pm UTC](https://root-forum.cern.ch/t/need-help-with-learning-ttable-in-pyroot/63917 "2025-07-18T19:19:16Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sauravquantum](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/ee59a6/32.png) [@sauravquantum](https://root-forum.cern.ch/u/sauravquantum)\
**Post date:** [July 18, 2025, 7:19pm UTC](https://root-forum.cern.ch/t/need-help-with-learning-ttable-in-pyroot/63917/1 "2025-07-18T19:19:17Z")

</div>

Hi,

I am needing to make a simple table of data in pyROOT. I am wanting to make something simple like this:

 ![5b6104bb-46ce-4cf8-86a3-03c29793ced1](https://root-forum.cern.ch/uploads/default/original/3X/4/d/4da0dc9dca16488ecccec291c59623878c52c5da.png)

If anyone can provide some pyROOT example of a table that would be nice. Thank you.

---

<div class="post-metadata">

**Author:** ![pcanal](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pcanal/32/12439_2.png) [@pcanal](https://root-forum.cern.ch/u/pcanal)\
**Post date:** [July 18, 2025, 7:45pm UTC](https://root-forum.cern.ch/t/need-help-with-learning-ttable-in-pyroot/63917/2 "2025-07-18T19:45:08Z")

</div>

What is the purpose of the table? (eg. Just printed as shown?) What is the size of the table (a few rows and columns, hundreds of rows or columns, millions of rows)?

---

<div class="post-metadata">

**Author:** ![sauravquantum](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/ee59a6/32.png) [@sauravquantum](https://root-forum.cern.ch/u/sauravquantum)\
**Post date:** [July 18, 2025, 8:16pm UTC](https://root-forum.cern.ch/t/need-help-with-learning-ttable-in-pyroot/63917/3 "2025-07-18T20:16:32Z")

</div>

The size of the table I want is 9 rows by 3 columns. The purpose of the table above is the kind of table I want to make, so yes as shown. Just something very simple like that.

---

<div class="post-metadata">

**Author:** ![pcanal](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pcanal/32/12439_2.png) [@pcanal](https://root-forum.cern.ch/u/pcanal)\
**Post date:** [July 18, 2025, 8:35pm UTC](https://root-forum.cern.ch/t/need-help-with-learning-ttable-in-pyroot/63917/4 "2025-07-18T20:35:38Z")

</div>

Not really a PyROOT question then (unless I am still misunderstanding your need).  
See [https://stackoverflow.com/questions/9535954/printing-lists-as-tabular-data](https://stackoverflow.com/questions/9535954/printing-lists-as-tabular-data) a sample of possibilities on how to do this in Python.

---

<div class="post-metadata">

**Author:** ![sauravquantum](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/ee59a6/32.png) [@sauravquantum](https://root-forum.cern.ch/u/sauravquantum)\
**Post date:** [July 18, 2025, 9:17pm UTC](https://root-forum.cern.ch/t/need-help-with-learning-ttable-in-pyroot/63917/5 "2025-07-18T21:17:16Z")

</div>

Oh, you can’t make tables that stem from ROOT? I didn’t know that. Thank you. I’ll just use LATEX then.

---

<div class="post-metadata">

**Author:** ![pcanal](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pcanal/32/12439_2.png) [@pcanal](https://root-forum.cern.ch/u/pcanal)\
**Post date:** [July 18, 2025, 9:34pm UTC](https://root-forum.cern.ch/t/need-help-with-learning-ttable-in-pyroot/63917/6 "2025-07-18T21:34:24Z")

</div>

> [@sauravquantum](#):
>
> you can’t make tables that stem from ROOT?

What do you mean by that? (the answer is probably actually yes but how depends on the actual context .. eg. LATEX syntax can be used in several ROOT context").

---

<div class="post-metadata">

**Author:** ![ferhue](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ferhue/32/29462_2.png) [@ferhue](https://root-forum.cern.ch/u/ferhue)\
**Post date:** [July 20, 2025, 3:38pm UTC](https://root-forum.cern.ch/t/need-help-with-learning-ttable-in-pyroot/63917/7 "2025-07-20T15:38:22Z")

</div>

> [@Using Tables in ROOT](https://root-forum.cern.ch/t/using-tables-in-root/46077/2):
>
> Dear Diego I also struggled to find some code example using TTable objects. I guess one has to try it and follow the Doxygen to see whether it works fine for you . Alternatively if you work within a python environment I would suggest to try one of the many packages for table printing , I usually use PrettyTable module or if you want to deal with latex directly you might want to look up pylatex. Within c++ you can also find several tables c++ implementation. Among the ones I found , I guess th…
