Jump to content

Set cell alignment for a column?


cswart

Recommended Posts

I know there's a way to set text alignment within a cell by using <p br=false quad=R>. Is there a way to have an alignment apply to an entire column in a table though without affecting the other columns? I have a table with 6 columns. 3 of them need to be right aligned and the other 3 need to be left aligned and it seems it would be much easier to apply this to an entire column rather than to all of the individual cells within that column....
Link to comment
Share on other sites

I know there's a way to set text alignment within a cell by using <p br=false quad=R>. Is there a way to have an alignment apply to an entire column in a table though without affecting the other columns? I have a table with 6 columns. 3 of them need to be right aligned and the other 3 need to be left aligned and it seems it would be much easier to apply this to an entire column rather than to all of the individual cells within that column....

No, although you should be able to do a simple iteration of all the rows in the table to apply the desired alignment to each each column. Something like this:

for (var r = 0; r < table.Rows.length; r++)
{
   table.Rows[r].Cells[0].Content = '<p br=false quad=R>' + table.Rows[r].Cells[0].Content;
   table.Rows[r].Cells[1].Content = '<p br=false quad=L>' + table.Rows[r].Cells[1].Content;
   table.Rows[r].Cells[2].Content = '<p br=false quad=C>' + table.Rows[r].Cells[2].Content;
}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...