Stump the Panel » End Users and Information Workers

dataview column header... line break?

(12 posts)
  • Started 5 months ago by illegal operation
  • Latest reply from jaxkookie
  1. illegal operation
    Member

    Hi,
    I haven't seen this asked yet, but this seems like this would be a common question.

    On a dataview column header, if the header is multiple words, it pushes the column width out to make it all fit on 1 line. So the columns become way to wide for the data they contain.

    How can I make it so, the headers have a line break?

    So instead of

    column header 1

    it could be

    column
    header 1

    I tried turning word wrap off, and that didn't do it. I've tried just forcing the column width smaller, but it won't let me do that either.

    Posted 5 months ago #
  2. illegal operation
    Member

    This has to be possible?
    I've seen some CSS methods posted in other places, but in SPD there has to be a way to do this manually without having to use CSS?

    right?

    I want to be able to adjust my column widths, but the headers are so long in SPD it won't allow me to make them any smaller?

    Posted 5 months ago #
  3. Sorry, just saw this.

    In SPD, remove the <nobr>…</nobr> tags from around the header text and they will then break for you.

    Blessings,
    Jim Bob

    Posted 5 months ago #
  4. illegal operation
    Member

    I don't see those tags in the page,

    Here is one of my headers

    [code]
    <TH nowrap="" scope="col" class="style4" style="padding; width: 64px;">
    <xsl:call-template name="dvt.headerfield" ddwrt:atomic="1" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime">
    <xsl:with-param name="fieldname">@Number_x0020_Licenses_x0020_Need</xsl:with-param>
    <xsl:with-param name="fieldtitle">Number Licenses Needed</xsl:with-param>
    <xsl:with-param name="displayname">Number Licenses Needed</xsl:with-param>
    <xsl:with-param name="sortable">1</xsl:with-param>
    <xsl:with-param name="fieldtype">x:float</xsl:with-param>
    </xsl:call-template>
    </TH>
    [/code]

    is this the right area?

    Posted 5 months ago #
  5. Sorry, my bad...

    Here's the fix for what you want to do:

    1. Within the fieldtitle parameter, put an HTML break (<br />) where you want the text to wrap.

    <xsl:with-param name="fieldtitle">Number<br />Licenses<br />Needed</xsl:with-param>

    2. Search for <xsl:value-of select="$fieldtitle" /> and change it to:

    <xsl:copy-of select="$fieldtitle" />

    Note: Leave alone the one inside the <xsl:when test="$fieldtype = 'Attachments'">. Only change the one in the <xsl:otherwise>.

    Save and test to make sure it looks the way you want it to.

    Blessings,
    Jim Bob

    Posted 5 months ago #
  6. illegal operation
    Member

    thank you,
    I had been trying the
    in the field title, but I didn't know about the next step.

    Thank You!

    Posted 5 months ago #
  7. You're very welcome!

    Posted 5 months ago #
  8. And here's another bit of information you can use regarding the label column on New- and EditForms:

    How to get column names to wrap in #SharePoint new item forms (NewForm.aspx) by my friend, Kevin Pine, at SharePoint Solutions.

    Blessings,
    Jim Bob

    Posted 4 months ago #
  9. An easier solution is to edit the cell properties of the table. Uncheck the "no wrap" option. Then you can click on the individual cell where the text is long and insert a break wherever you wish it to be. The header cell will then adjust the width and height to fit.

    Posted 4 months ago #
  10. illegal operation
    Member

    An easier solution is to edit the cell properties of the table. Uncheck the "no wrap" option. Then you can click on the individual cell where the text is long and insert a break wherever you wish it to be. The header cell will then adjust the width and height to fit.

    That was actually the first thing I tried, and it doesn't work. It will only allow you to adjust the cell to the width of the line of text, it won't go any smaller and the text won't wrap. Doesn't make sense, it should work.

    Posted 4 months ago #
  11. illegal operation
    Member

    Hi again,

    I had another question related to these type of column headers. How do you center them?

    I've tried centering the cell and it doesn't make any difference.
    I have one table header column that I want to center, and I just can't seem to get it to work.

    Posted 1 month ago #
  12. jaxkookie
    Member

    This post may help.
    http://www.endusersharepoint.com/STP/topic/sharepoint-jquery-setting-view-column-width#post-8956

    and here is some css i was able to manipulate column headers with
    [style type="text/css"]
    .ms-viewheadertr td, .ms-viewheadertr a {
    writing-mode: tb-rl;
    filter:fliph flipv ;
    text-align:left;
    vertical-align:top;
    text-align:left;
    /*text-wrap:normal;
    LAYOUT-FLOW: vertical-ideographic;

    writing-mode: tb-rl;
    direction: ltr;
    filter:flipv fliph;
    word-wrap:normal;

    white-space:normal;
    white-space-collapse:collapse;
    */
    color: black !important;
    }
    [/style]

    Posted 1 month ago #

RSS feed for this topic

Reply

You must log in to post.