Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. SharePoint
  4. DVWP Wrap Column Headings

DVWP Wrap Column Headings

Scheduled Pinned Locked Moved SharePoint
csscomxmlhelptutorial
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    svaa
    wrote on last edited by
    #1

    I want to wrap column headings for the Data View Web Part. For example I want the "On Hand To Be Allocated" to display as:

    "On Hand
    To Be Allocated"

    I have been trying to do this for a while. I would really appreciate your help.

    These are parts of my dvwp code that I think may be relavant. I would appreciate if you or anyone else can help. (Though I have tried a few things, I have pasted the original code):

    <style type="text/css">
    .style2 {
    font-weight: normal;
    color: #003759;
    text-align: left;
    text-decoration: none;
    vertical-align: top;
    font-size: 8pt;
    line-height: 1.2;
    font-family: Verdana, Helvetica, sans-serif;
    white-space: nowrap;
    height: 21px;
    padding-top: 1px;
    padding-bottom: 0px;
    background-repeat: repeat-x;
    }
    

    and

    </th>
    <th class="style2" nowrap="nowrap">
    <xsl:call-template name="dvt.headerfield" ddwrt:atomic="1" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime">
    <xsl:with-param name="fieldname">@ows\_On\_x0020\_Hand\_x0020\_To\_x0020\_Be\_</xsl:with-param>
    <xsl:with-param name="fieldtitle">On Hand To Be Allocated</xsl:with-param>
    <xsl:with-param name="displayname">On Hand To Be Allocated</xsl:with-param>
    <xsl:with-param name="sortable">1</xsl:with-param>
    <xsl:with-param name="fieldtype">Text</xsl:with-param>
    </xsl:call-template>
    </th>
    

    and

    <td class="style3" style="height: 50px; ">
    <xsl:value-of select="format-number(@ows\_On\_x0020\_Hand\_x0020\_To\_x0020\_Be\_, &quot;#,##0.;-#,##0.&quot;)"/>
    </td>
    

    Thanks.

    N 1 Reply Last reply
    0
    • S svaa

      I want to wrap column headings for the Data View Web Part. For example I want the "On Hand To Be Allocated" to display as:

      "On Hand
      To Be Allocated"

      I have been trying to do this for a while. I would really appreciate your help.

      These are parts of my dvwp code that I think may be relavant. I would appreciate if you or anyone else can help. (Though I have tried a few things, I have pasted the original code):

      <style type="text/css">
      .style2 {
      font-weight: normal;
      color: #003759;
      text-align: left;
      text-decoration: none;
      vertical-align: top;
      font-size: 8pt;
      line-height: 1.2;
      font-family: Verdana, Helvetica, sans-serif;
      white-space: nowrap;
      height: 21px;
      padding-top: 1px;
      padding-bottom: 0px;
      background-repeat: repeat-x;
      }
      

      and

      </th>
      <th class="style2" nowrap="nowrap">
      <xsl:call-template name="dvt.headerfield" ddwrt:atomic="1" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime">
      <xsl:with-param name="fieldname">@ows\_On\_x0020\_Hand\_x0020\_To\_x0020\_Be\_</xsl:with-param>
      <xsl:with-param name="fieldtitle">On Hand To Be Allocated</xsl:with-param>
      <xsl:with-param name="displayname">On Hand To Be Allocated</xsl:with-param>
      <xsl:with-param name="sortable">1</xsl:with-param>
      <xsl:with-param name="fieldtype">Text</xsl:with-param>
      </xsl:call-template>
      </th>
      

      and

      <td class="style3" style="height: 50px; ">
      <xsl:value-of select="format-number(@ows\_On\_x0020\_Hand\_x0020\_To\_x0020\_Be\_, &quot;#,##0.;-#,##0.&quot;)"/>
      </td>
      

      Thanks.

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      You don't need to format the entire post, only the code lines. Have you tried to add a <br/> element? Maybe place the title in a span with specific width?


      Failure is not an option; it's the default selection.

      S 1 Reply Last reply
      0
      • N Not Active

        You don't need to format the entire post, only the code lines. Have you tried to add a <br/> element? Maybe place the title in a span with specific width?


        Failure is not an option; it's the default selection.

        S Offline
        S Offline
        svaa
        wrote on last edited by
        #3

        I have very limited knowledge about code. Can you please explain how to use the
        element? Thank you.

        N 1 Reply Last reply
        0
        • S svaa

          I have very limited knowledge about code. Can you please explain how to use the
          element? Thank you.

          N Offline
          N Offline
          Not Active
          wrote on last edited by
          #4

          If you "very limited knowledge about code" then you have no business attempting this. Go learn about XSLT and HTML first. Seriously, nothing I could say would make sense to you until you have a basic level of knowledge.


          Failure is not an option; it's the default selection.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups