# Can you always show table columns?

**URL:** <https://forum.inductiveautomation.com/t/can-you-always-show-table-columns/104171>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [March 25, 2025, 3:57pm UTC](https://forum.inductiveautomation.com/t/can-you-always-show-table-columns/104171 "2025-03-25T15:57:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![NP209](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/np209/32/80704_2.png) [@NP209](https://forum.inductiveautomation.com/u/NP209)\
**Post date:** [March 25, 2025, 3:57pm UTC](https://forum.inductiveautomation.com/t/can-you-always-show-table-columns/104171/1 "2025-03-25T15:57:29Z")

</div>

Currently I have a dynamic name query setup to look through multiple tables on the fly and make edits.

I have noticed when a table has no rows of data the table will remain empty even if there are columns in the table.

Is there a way to make the columns always visible even if there are no rows of data?

Edit: Actually I figured out a solution to my own question lol.But it was made better with the help of PGriffith.

```python
if value.rowCount == 0:
		column_names = list(value.columnNames) # Ensure columnNames is a list of strings
		return system.dataset.toDataSet(column_names, [[None] * value.columnCount])
	return value

```

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [March 25, 2025, 4:28pm UTC](https://forum.inductiveautomation.com/t/can-you-always-show-table-columns/104171/3 "2025-03-25T16:28:37Z")

</div>

Pointless golf:

```python
if value.rowCount == 0:
    return system.dataset.toDataSet(
        value.columnNames,
        [[None] * value.columnCount]
    )

return value

```

---

<div class="post-metadata">

**Author:** ![NP209](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/np209/32/80704_2.png) [@NP209](https://forum.inductiveautomation.com/u/NP209)\
**Post date:** [March 25, 2025, 5:12pm UTC](https://forum.inductiveautomation.com/t/can-you-always-show-table-columns/104171/4 "2025-03-25T17:12:32Z")

</div>

That wasn't working for me, i had to change it slightly. I was getting a coerced error. Here's what I ended up with after your help! Thanks 😀:

```python
if value.rowCount == 0:
		column_names = list(value.columnNames)
		return system.dataset.toDataSet(column_names, [[None] * value.columnCount])
	return value

```
