cswart Posted April 3, 2012 Share Posted April 3, 2012 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.... Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted April 3, 2012 Share Posted April 3, 2012 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; } Quote Link to comment Share on other sites More sharing options...
cswart Posted April 3, 2012 Author Share Posted April 3, 2012 Thanks Dan! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.