Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Word wrap??

  Asked By: Ashu    Date: Apr 30    Category: Sharepoint    Views: 3382

I have a seemingly simple question - but darned if I can figure out
how to do it! I have a custom list in SP 2003, and one of the field
names is very long. SharePoint insists on displaying this field name
on a single line in the "New Item" form, which pushes the input boxes
off the screen. How on earth can I get it to wrap?



2 Answers Found

Answer #1    Answered By: Irving Hurley     Answered On: Apr 30

The only simple  answer to your question  is to name the field with
a shorter name.

OK, two. You can increase your screen resolution to 2600x2000 so that
you see the entire new item page or get a really wide screen or two
side-by-side screens.

Really, there isn't anything that you can put into the name of the field
that will cause it to create a new line. You cannot use a <br /> or \n
or even unencode("\n"). This is because user entered fields are always
HTML encoded to prevent user's from injecting script or SQL into a
SharePoint page. Imagine if I could name a field:


There _is_ a hard way to do this on a case by case basis. By capturing
the HTML DOM element that contains the display name that you want to
wrap using JavaScript after the page loads. Once captured, you can
manually insert a <br /> at the appropriate location(s) to force the new
line. However, this is a very fragile solution and should not be lightly
undertaken. In other words, this is a one off solution that will only
work on a page by page basis.

So, again, the simple answer is to use a shorter name for the field.

Answer #2    Answered By: Suzanne Mcdonald     Answered On: Jan 20

Try this CSS in a CEWP in the New form:

.ms-standardheader nobr {
width: 50px !important;

.ms-formlabel {
width: 50px !important;

Didn't find what you were looking for? Find more on Word wrap?? Or get search suggestion and latest updates.