html - How I can set the background image to table cells that have a colspan? -


i use css set background cell not apply whole cell.

i trying set background image first , last <tr>, it's showing this.

i trying apply .first class property first , last <tr>. should applies tr?

 <html xmlns="http://www.w3.org/1999/xhtml">     <head>     <meta http-equiv="content-type" content="text/html; charset=utf-8" />     <title>untitled document</title>     <style type="text/css">   .excel{          background:url(smallimage/excel.jpg);           background-size:24px 24px;           background-repeat:no-repeat;           position: relative;            margin:3px;            left: 2px;             top: 1px;         }           td.yellostar{         background-image: url(smallimage/yellowstar.jpg);  /* forward slash path */         width: 20px; /* use own image size; */         height: 20px; /* use own image size; */         background-repeat: no-repeat;         background-position: center;         text-align: center;         vertical-align: top;         }          .first{         background-image:url(smallimage/trbackgr.jpg);         background-repeat: repeat-x;         }      </style>     </head>      <body>     <table width="95%" border="1" cellspacing="0" cellpadding="0">         <tr class="first">         <th colspan="2" class="first">chapter #|chapter name</th>         <th>linkage</th>         <th>project<br/>count</th>         <th>task<br>count</th>         <th>issues<br> open/all</th>         <th>action</th>        </tr>         <tr >         <td>05</td>         <td><div class="excel" > &nbsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp<u>chapter 5:data of information</div></td>         <td class="yellostar" ></td>         <td><p align="center">3</p></td>         <td><p align="center">21</p>         </td>         <td>&nbsp;</td>         <td>&nbsp;</td>       </tr>       <tr>         <td>06</td>         <td><div class="excel">&nbsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp<u>chapter 6:data tabels , amortization tabels</div></td>         <td class="yellostar">&nbsp;</td>         <td>&nbsp;</td>         <td>&nbsp;</td>         <td>&nbsp;</td>         <td>&nbsp;</td>       </tr>       <tr>         <td>07</td>         <td><div class="excel" >&nbsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp<u>chapter 7:data consolidation,links , formula auditing</div></td>         <td class="yellostar">&nbsp;</td>         <td>&nbsp;</td>         <td>&nbsp;</td>         <td>&nbsp;</td>         <td>&nbsp;</td>       </tr>       <tr>         <td>08</td>         <td><div class="excel" >&nbsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp<u></td>         <td class="yellostar">&nbsp;</td>         <td>&nbsp;</td>         <td>&nbsp;</td>         <td>&nbsp;</td>         <td>&nbsp;</td>       </tr>       <tr>         <td>09</td>         <td><div class="excel" >&nbsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp<u></div></td>         <td class="yellostar">&nbsp;</td>         <td>&nbsp;</td>         <td>&nbsp;</td>         <td>&nbsp;</td>         <td>&nbsp;</td>       </tr>       <tr>         <td>10</td>         <td><div class="excel" >&nbsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp<u></div></td>         <td class="yellostar">&nbsp;</td>         <td>&nbsp;</td>         <td>&nbsp;</td>         <td>&nbsp;</td>         <td>&nbsp;</td>       </tr>       <tr class="first">           <td colspan="7" class="first" >&nbsp;</td>       </tr>     </table>     </body>     </html> 

you can use pseudoclasses :first-child , :last-child . @ example: jsfiddle

but :last-child not cross-browser, fixes needed ie.

and have error in specifying reference image background w3schools.


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -