Click here to Skip to main content
15,889,462 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
CSS applied

CSS
/* DEMO TABLE */
body {
    font-size: 75%;
    font-family: Verdana, Tahoma, Arial, "Helvetica Neue", Helvetica, Sans-Serif;
    color: #232323;
    background-color: #fff;
}
table { border-spacing:0; border:1px solid gray;}
table.tablesorter thead tr .header {
	background-image: url(Content/images/bg.png);
	background-repeat: no-repeat;
	background-position: center right;
	cursor: pointer;
}
table.tablesorter tbody td {
	color: #3D3D3D;
	padding: 4px;
	background-color: #FFF;
	vertical-align: top;
}
table.tablesorter tbody tr.odd td {
	background-color:#F0F0F6;
}
table.tablesorter thead tr .headerSortUp {
	background-image:url(Content/images/asc.png);
}
table.tablesorter thead tr .headerSortDown {
	background-image: url(Content/images/desc.png);
}
table th { width:150px; 
           border:1px outset gray; 
           background-color:#3C78B5; 
           color:White; 
           cursor:pointer;
}
table thead th:hover { background-color:Yellow; color:Red;}
table td { width:150px; border:1px solid gray;}





Html in .aspx
<pre lang="HTML">    <script type="text/javascript">
        $(function () {
            $("table.tablesorter").tablesorter({ widthFixed: true, sortList: [[0, 0]] })
            .tablesorterPager({ container: $("#pager"), size: $(".pagesize option:selected").val() });
        });
    </script>

    <h2><%: ViewBag.Message%></h2>
    <div>
        <table id="tablesorter" class="tablesorter">
            <thead>
                <tr>
                    <th>Name</th>
                    <th>Surname</th>
                    <th>Email</th>
                    <th>Phone</th>
                    <th>Date Added</th>
                </tr>
            </thead>
            <tbody>
                <%  {
                        foreach (var p in ViewBag.People)
                        { %>        
                    <tr>
                        <td><%: p.Name%> </td>
                        <td><%: p.Surname%></td>
                        <td><%: p.Email%></td>
                        <td><%: p.Phone%></td>
                        <td><%: p.DateAdded%></td>
                    </tr>
                   <% } %> 
               <%} %>
            </tbody>
        </table>
        <div id="pager" style="removed:inherit;">
            <form>
            <img alt="" src="<%: Url.Content("~/Content/images/first.png") %>" class="first" /><%--"@Url.Content("~/Content/images/first.png")"--%>
            <img alt="" src="<%: Url.Content("~/Content/images/prev.png") %>" class="prev" />
            <input type="text" class="pagedisplay" />
            <img alt="" src="<%:Url.Content("~/Content/images/next.png") %>" class="next" />
            <img alt="" src="<%: Url.Content("~/Content/images/last.png") %>" class="last" />
            <select class="pagesize">
                <option selected="selected" value="5">5</option>
                <option value="10">10</option>
                <option value="20">20</option>
                <option value="30">30</option>
                <option value="40">40</option>
            </select>    
            </form>        
        </div>
    </div>


Above i have given the css i applied and the html code in my .aspx file. I'm using this but its not showing images in the header of table. I'm not getting this y this is not happening?
Posted

try doing this steps.
1. make sure you are getting the right path of the css file.; and
2. check if the path of the images are also correct in that css file.
 
Share this answer
 
Comments
BalaThakur 16-Aug-12 1:27am    
Yes i cheked that it is right.
graciax8 16-Aug-12 1:42am    
can you post your directory. what folder is the css file located and also the images.
Your code

CSS
table.tablesorter thead tr .header {
	background-image: url(Content/images/bg.png);
	background-repeat: no-repeat;
	background-position: center right;
	cursor: pointer;
}


Corrected code
CSS
table.tablesorter thead tr .header {
	background-image: url(~/Content/images/bg.png);//changed here
	background-repeat: no-repeat;
	background-position: center right;
	cursor: pointer;
}
 
Share this answer
 
Comments
BalaThakur 16-Aug-12 1:34am    
still its nt wrking
...
hii
make sure your path is correct
url(Content/images/desc.png);

for example
folder structure is

application
css
style.css
images
image1.jpg


then your path must be as
url(../images/image1.jpg)

where '..' means one folder back
 
Share this answer
 
try to open the image from visual studio...
if you can open it check url in css..
folder name, image file name...

if any error remove and agin addd the same

if all are correct try another image...
 
Share this answer
 
v2
it is just path problem. you should check the path of image where it is located and then use that path and use like this
background-image: url(~/Content/images/bg.png);
and also check extension of image ?



Please Vote if it helps you
 
Share this answer
 
v2

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