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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...