Jump to content

Format A Column In Tabular Report Without Modifying The Style


Recommended Posts

Hello again,

 

Does anyone know how to format a column or columns in tabular report page, without modifying the "Style"? 

 

I only wish to format a few columns to align in the middle. The rest of the columns in my tabular report must remain aligned left.

 

Any workaround by way of  Javascript?

 

Anyone? Please help.

 

I attached a snapshot of my issue (for drama)  :-)

 

The "Years of Service (YOS)" column is what I wanted to align in the middle.

 

 

Thank you in advance, I appreciate all the valuable knowledge in here.

 

Elena

post-16115-0-05583400-1450293361_thumb.g

Link to comment
Share on other sites

Hello Elena,

 

You can add the following code to the header:

<style>
#target table:nth-of-type(1) th:nth-of-type(3) {color: red;}
#target table:nth-of-type(1) td:nth-of-type(3) {color: red;}
</style>
<div id="target">

And the following code to the footer:

</div>

3 in the "th:nth-of-type(3)" and in the "td:nth-of-type(3)" is the number of column.

th:nth-of-type{} defines the style of the header,

td:nth-of-type{} defines the style of records.

You can add as many columns as you want.

 

If the code does not work, you can try changing the number in "table:nth-of-type(1)" - to "2", or to "3".

 

I hope, it helps.

Link to comment
Share on other sites

  • 5 years later...

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.

Loading...
×
×
  • Create New...