Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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.

or

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

I'm Using Sharepoint 2010

share|improve this question

2 Answers 2

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: http://blog.pathtosharepoint.com/2008/09/01/using-calculated-columns-to-write-html/

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

Your Answer

 
discard

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.