SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In my list, I want a column to have a custom hyperlink.

I create a Calculated column that has the following formula.

="<a href='/_Layouts/tf.intranet/TFLutakastPage.aspx?LutakastId="&ID&"'>"&Title&"</a>"

enter image description here

I set the returned data type as Single line of text.

When the column renders, it renders like this. enter image description here

If i set the column to render as a number, I can get the hyperlink to render correctly.

enter image description here

But then the problem is that the text is right aligned. Customer wants it left aligned.

I then tried changing the column formula to

="<DIV align=""left""><a href='/_Layouts/tf.intranet/TFLutakastPage.aspx?LutakastId="&ID&"'>"&Title&"</a></DIV>"

This will solve the problem with the link, but the header text is still right aligned.

enter image description here

How can i:

A. Get the hyperlink to render as a text field.


B. Leave it as a number field and left align the header column.

I'm Using Sharepoint 2010

share|improve this question
up vote 1 down vote accepted

This article is a bit dated, but it shows you how to properly do HTML in your calculated columns:

I would avoid using the number column method as your alignment issues would be impossible to fix adequately without affecting other columns.

share|improve this answer
Works like a charm :) Thanx – Oddmar Dam Dec 5 '12 at 9:45

I have changed the calculated column display format to "Date and time" "Date Only" Option. it will Right Align the values.

share|improve this answer

Not sure this will work in 2010, but in 2013 the simplest (and most limited) solution is to add a CEWP to the page, click Edit Source and add css to left align the header text:

.ms-numHeader {text-align: left;}

...enclosed in style tags. Worked for me anyway...and thanks for the tip on how to left align the calculated field!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.