# Using Tables in ROOT

**URL:** <https://root-forum.cern.ch/t/using-tables-in-root/46077>\
**Category:** Newbie\
**Created:** [July 29, 2021, 5:34pm UTC](https://root-forum.cern.ch/t/using-tables-in-root/46077 "2021-07-29T17:34:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mendoza](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/mendoza/32/26128_2.png) [@mendoza](https://root-forum.cern.ch/u/mendoza)\
**Post date:** [July 29, 2021, 5:34pm UTC](https://root-forum.cern.ch/t/using-tables-in-root/46077/1 "2021-07-29T17:34:22Z")

</div>

Dear users,

I write this topic because I don’t know how to work with tables in ROOT. I am a new user and I did not find any tutorial or information in the User’s guide and root page about how to use tables in ROOT. Basically, I need to store some information that I have in a histogram to a nice table to present in the future. I would really thank if you could give me some references to start my learning with this new tool.

Thanks in advance.

Best,

Diego

---

<div class="post-metadata">

**Author:** ![RENATO\_QUAGLIANI](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/renato_quagliani/32/19496_2.png) [@RENATO\_QUAGLIANI](https://root-forum.cern.ch/u/RENATO_QUAGLIANI)\
**Post date:** [July 29, 2021, 7:59pm UTC](https://root-forum.cern.ch/t/using-tables-in-root/46077/2 "2021-07-29T19:59:39Z")

</div>

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 the single header one from [GitHub - p-ranav/tabulate: Table Maker for Modern C++](https://github.com/p-ranav/tabulate) looks quite nice.

I hope this is what you meant by using tables in ROOT. I am not aware of direct conversion of histograms to tables, you can however navigate the histogram content and produce a nicely printed table with any external class or custom code.

Cheers  
Renato

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [July 29, 2021, 8:10pm UTC](https://root-forum.cern.ch/t/using-tables-in-root/46077/3 "2021-07-29T20:10:32Z")

</div>

“`TTable`” no longer exists in newer ROOT versions.

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [July 29, 2021, 8:36pm UTC](https://root-forum.cern.ch/t/using-tables-in-root/46077/4 "2021-07-29T20:36:35Z")

</div>

And btw `TTable` wasn’t about text output 🙂 Are you looking for a tool that prints a table of data? Then indeed, Renato’s answer is perfect! (ROOT doesn’t need to provide everything itself if there are nice packages that it can interface with 🙂 )

---

<div class="post-metadata">

**Author:** ![mendoza](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/mendoza/32/26128_2.png) [@mendoza](https://root-forum.cern.ch/u/mendoza)\
**Post date:** [August 4, 2021, 4:04pm UTC](https://root-forum.cern.ch/t/using-tables-in-root/46077/5 "2021-08-04T16:04:00Z")

</div>

Hi all!

Thanks for the references and the help. I left a bit this task for later but I recently could find a way to obtain a nice table using python and pylatex, so I could use it for future reports/presentations! It is just what I wanted.

Cheers,

Diego
