简体   繁体   中英

HTML title attribute line break

I am trying to generate a tool tip text using SQL. The text generated is passed as Title Attribute in HTML. There needs to be some newline characters generated in the tool tip. I have used the following - &#10; CHAR(13) ; CHAR(10) ; <br> ; \\n . However in all cases, I see the character itself in HTML and not a new line. Any idea how to achieve this?

the SQL is something like this

   (SELECT
      STUFF(';' + WOR.OrderNo + ' - ' + P.ProductNo + ' - ' + CAST(CAST(ROUND(WOR.OrderQuantity , 0) as int) as varchar(20)) + '; <br/> ', 1, 1, '') 
       FROM
          [ORDER] WOR 
          JOIN
             PRODUCT P 
             ON P.ID = WOR.ProductID 
          JOIN
             PRODUCT_GROUP PGR 
             ON P.ID = PGR.ProductID FOR XML PATH(''),TYPE).value('.','nvarchar(MAX)')```

And the Tootip that I see is the following

```SMU_100000021 - A-WHEL-001 - 100;<br/>SMU_100000023 - A-WHEL-001 - 90;<br/>```

The CHAR(10) did the trick.

(SELECT
      STUFF(';' + WOR.OrderNo + ' - ' + P.ProductNo + ' - ' + CAST(CAST(ROUND(WOR.OrderQuantity , 0) as int) as varchar(20))  +' '+ CHAR(10) + ' ', 1, 1, '') 
       FROM
          [ORDER] WOR 
          JOIN
             PRODUCT P 
             ON P.ID = WOR.ProductID 
          JOIN
             PRODUCT_GROUP PGR 
             ON P.ID = PGR.ProductID FOR XML PATH(''),TYPE).value('.','nvarchar(MAX)')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM