# Text alignment with Multi-Line Param in a Table

**URL:** <https://rossvideo.community/t/text-alignment-with-multi-line-param-in-a-table/8759>\
**Category:** Automation & Control\
**Created:** [March 17, 2023, 2:51pm UTC](https://rossvideo.community/t/text-alignment-with-multi-line-param-in-a-table/8759 "2023-03-17T14:51:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vincentaeberhard](https://rossvideo.community/letter_avatar_proxy/v4/letter/v/a88e57/32.png) [@vincentaeberhard](https://rossvideo.community/u/vincentaeberhard)\
**Post date:** [March 17, 2023, 2:51pm UTC](https://rossvideo.community/t/text-alignment-with-multi-line-param-in-a-table/8759/1 "2023-03-17T14:51:00Z")

</div>

Hi,

I am currently creating a chat window in DashBoard using a multi-line parameter. The chat functionality works as expected, but it does look strange the way a multi-line param is implemented as a table. the entries are centered, but at the same time left-aligned. I did not find a way to align differently.

Is there an easy way? I attached my grid file so you can see what I mean.

---

<div class="post-metadata">

**Author:** ![jamespeltzer](https://rossvideo.community/user_avatar/rossvideo.community/jamespeltzer/32/50_2.png) [@jamespeltzer](https://rossvideo.community/u/jamespeltzer)\
**Post date:** [April 13, 2023, 11:08am UTC](https://rossvideo.community/t/text-alignment-with-multi-line-param-in-a-table/8759/2 "2023-04-13T11:08:00Z")

</div>

Hi Vincent  
Sorry for the delayed response. Your best option is probably to use a script table to inject HTML around your multiline text data - this will give you complete control over how it is rendered. The default renderer only uses enough width to display the data and centers additional lines within it - you can overcome this limitation by specify an absolute width.  
Attached is a modified version of your panel that uses the script table with HTML wrapping:

 Username1: Short Text With new Line Username2: Long Text with a lot written on the first line until the end of the box and a short second line Username1: Username1: Username1: this is a long one chatMaster var model = {

```
  htmlIfy: function(str)
  {
     return '<html><body><div style="width: 800px; text-align:center">' + str.split('&amp;').join('&amp;amp;').split('<').join('&amp;lt;').split('\n').join('<br/>') + '</div></html>';
  },

  getRowCount: function()
  {
     return params.getElementCount('chatMaster');
  },

  getColumnCount: function()
  {
     return 1;
  },
  
  getValueAt: function(row, col)
  {
     return this.htmlIfy(params.getValue('chatMaster', row) + '');
  }

```

};  
model.model.rowCountChanged(model.getRowCount());

|
| |

 var listCount = params.getElementCount('chatMaster');

if (listCount == 1 && params.getValue(‘chatMaster’, 0) == “”) // If this is the first element and it has not been set yet  
{  
listCount = 0;  
}

var newName = params.getValue(‘userName’, 0);  
var newChat = params.getValue(‘userChat’, 0);  
var newValue = newName + “:” + “\n” + newChat;

params.setValue(‘chatMaster’, listCount, newValue);  
params.setValue(‘userChat’, 0, “”);

 false false 10,10 model params.setAllValues('chatMaster', ['']);
