Click here to Skip to main content
15,917,176 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi

how to add ellipsis in one column of a table i will share my code please help .


C#
var td1 = document.createElement('td');
        td1.setAttribute('width', '3%');
        td1.setAttribute("align","center");
        td1.innerHTML = r[i].platformNo;;

        var td2 = document.createElement('td');
        td2.setAttribute('width', '42%');
        td2.setAttribute("align","center");
        td2.innerHTML = r[i].originSchDepart + " - " + r[i].fromSchDepart;
*******************Here i want to add ellipsis   so that if station name is more than 10 character it show dot********
        var td3 = document.createElement('td');
        td3.setAttribute('width', '45%');
        td3.setAttribute("align","center");
        td3.innerHTML =  r[i].stationName + " (" + r[i].crsCode + ")";;

        var td4 = document.createElement('td');
        td4.setAttribute('width', '5%');
        td4.setAttribute("align","center");

        var td5 = document.createElement('td');
        td5.setAttribute('width', '5%');
        td5.setAttribute("align","center");
            if(r[i].expArrival ==  r[i].schArrival)
    {
        td4.innerHTML = "<img src=\"images/correct-icon.png\" width=\"24\" height=\"24\" />";
        td5.innerHTML="";
    }
    else
    {
        td4.innerHTML = "<img src=\"images/error.png\" width=\"24\" height=\"24\" />";
        td5.innerHTML=r[i].expArrival;
    }

        tr.appendChild(td1);
        tr.appendChild(td2);
        tr.appendChild(td3);
        tr.appendChild(td4);
        tr.appendChild(td5);
        tbl.appendChild(tr);
Posted
Comments
Dasaradhi_r 6-Sep-12 7:26am    
Is your problem solved?

1 solution

You have to use "jsDraw2D" library to achieve this.
This is a pure JavaScript library to draw 2D graphics on web pages inside web browser without using SVG,VML or Canvas.

The below link has a detailed description:
http://jsdraw2d.jsfiction.com[^]

To draw a circle:
http://stackoverflow.com/questions/9212902/how-to-generate-circle-using-javascript[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900