# Table formatting bug

**URL:** <https://forum.inductiveautomation.com/t/table-formatting-bug/1410>\
**Category:** Archived Topics\
**Created:** [December 15, 2009, 10:54pm UTC](https://forum.inductiveautomation.com/t/table-formatting-bug/1410 "2009-12-15T22:54:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlThePal](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/althepal/32/3603_2.png) [@AlThePal](https://forum.inductiveautomation.com/u/AlThePal)\
**Post date:** [December 15, 2009, 10:54pm UTC](https://forum.inductiveautomation.com/t/table-formatting-bug/1410/1 "2009-12-15T22:54:57Z")

</div>

I think I’ve found a fairly subtle bug in table formatting.

I have a table in a window (see attached Window 2) whose data property is tied to a [Client] dataset testData. This dataset has 4 columns with the following headings and types: 1 (string), 2 (integer), 3 (float) and 4 (double). The formatting for the 3 number columns is set to show a defined number of decimal places.

I open Window 2 using one of 2 buttons on Window 1 (also attached). One button (“OK”) creates a dataset with one line of data in it before opening Window 2 - this data is displayed with the correct formatting. Pressing the button in Window 2 adds another line, also with the correct formatting. The other button (“Faulty”) creates an empty dataset before opening Window 2. When the button in Window 2 is pressed to add a new line of data to the empty table, the formatting information of the table is ignored and the data is displayed in its raw form.

How can I preserve the formatting of the table, yet open it with no data already displayed?  
[Table formatting bug.fwin](https://us1.discourse-cdn.com/inductiveautomation/original/1X/a931b12b94434bc1f182daf5c8cc3d1be76056f6.fwin) (17.6 KB)

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [December 17, 2009, 8:58pm UTC](https://forum.inductiveautomation.com/t/table-formatting-bug/1410/2 "2009-12-17T20:58:16Z")

</div>

That is a subtle one… I agree, its a bug.

Try this for a workaround. Change the code of “Faulty” to:

`header = ["1", "2", "3", "4"]
data = []
data.append(["One",1,1.000001,1.000001]) # sets the types
newDataSet = fpmi.dataset.toDataSet(header, data)
newDataSet = fpmi.dataset.removeRow(newDataSet,0)
fpmi.tag.writeToTag("[Client]testData",newDataSet)
fpmi.nav.openWindow("Window 2")`
