SUBSTRING(), HTML tags issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • KUTTAN
    New Member
    • Mar 2007
    • 33

    SUBSTRING(), HTML tags issue

    In my home page I am showing a small part of my product’s description.



    I am achieving this by using “SUBSTRING” function in sql server stored prodedure.



    SUBSTRING(Produ ct.Description, 1,198)

    Description may contain HTML data or pure text



    That all is ok



    But this create a problem in my page layout,

    The lay out became ugly occasionally

    I found the reason as by taking only 198 character

    HTML tags like <table> and <div>

    Will not be closed properly



    for emaple a sample data is as

    <TABLE cellSpacing=1 cellPadding=2 width=311 border=1>
    <TBODY>
    <TR>
    <TD vAlign=top width="60%" bgColor=#ffffff height=24><B><F ONT face=Arial size=1>



    see <TABLE> <TBODY> <TR> <TD >all are not closed

    similarly DIV in some other case also causing the same problem



    Do any good practices to take handle this situation?


    --kuttan--
Working...