# Table print columnName as 1 row

**URL:** <https://discourse.processing.org/t/table-print-columnname-as-1-row/27465>\
**Category:** Coding Questions\
**Created:** [January 29, 2021, 4:50pm UTC](https://discourse.processing.org/t/table-print-columnname-as-1-row/27465 "2021-01-29T16:50:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ren](https://avatars.discourse-cdn.com/v4/letter/r/ed655f/32.png) [@ren](https://discourse.processing.org/u/ren)\
**Post date:** [January 29, 2021, 4:50pm UTC](https://discourse.processing.org/t/table-print-columnname-as-1-row/27465/1 "2021-01-29T16:50:47Z")

</div>

How can I first print out on a single line all of my table’s column name of my table like this:  
X Y Z  
8 15.99 Oxygen

```auto
Table table;
  table = new Table();
  table.addColumn("X");
  table.addColumn("Y");
  table.addColumn("Z");

  table.setInt(0, "X", 8);
  table.setFloat(0, "Y", 15.99);
  table.setString(0, "Z", "Oxygen");
  print(table.getInt(0, "X") + " ");
  print(table.getFloat(0, "Y") + " ");
  print(table.getString(0, "Z") + " "); 

```

> > The Output now is:  
> > 8 15.99 Oxygen

> > I want this output:  
> > X Y Z  
> > 8 15.99 Oxygen

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [January 29, 2021, 5:14pm UTC](https://discourse.processing.org/t/table-print-columnname-as-1-row/27465/2 "2021-01-29T17:14:01Z")

</div>

[Processing.GitHub.io/processing-javadocs/core/processing/data/Table.html#getColumnTitles--](http://Processing.GitHub.io/processing-javadocs/core/processing/data/Table.html#getColumnTitles--)

```auto
final Table t = new Table();

t.setColumnTitles(new String[] { "X", "Y", "Z" });
t.setColumnTypes(new int[] { Table.INT, Table.FLOAT, Table.STRING });

t.addRow(new Object[] { 8, 15.99, "Oxygen" });

println(t.getColumnTitles());

print(t.getInt(0, "X"), TAB);
print(t.getFloat(0, "Y"), TAB);
println(t.getString(0, "Z"));

println();
t.print();

exit();

```
