How to apply color to the table row rather then each cells
Hi i want to use single <tr style="background: #FFB951;"> at start of html block for the following blocks of code but i do not know how to modify it so it does not disable the hyperlinks .In another word i want the color is applied to the table row rather than every individual cell.
Also i want to remove the underline for hyperlink.I be happy if some one help thanks
just like this :
http://www.vbforums.com/images/ieimages/2006/05/1.jpg
PHP Code:
<tr>
<td width="5%" bgcolor="#C0C0C0"><? echo $numbers; ?> </td>
<td width="35%" bgcolor="#C0C0C0"><a
href="albums.php?albumname=<?=strval( $row['artist'] );?>"><b><?=strval( $row['artist'] );?></b>
</a> </td>
<td width="10%" bgcolor="#C0C0C0">467 </td>
</tr>
second html
PHP Code:
<tr>
<td bgcolor="#C0C0C0"><? echo $numbers; ?> </td>
<td bgcolor="#C0C0C0"><a
href="./albumsongs.php?albumname=<?=strval( $row['album'] );?>&artistname=<?=strval( $row['artist'] );?>"><?=strval( $row['album'] );?></a> </td>
<td bgcolor="#C0C0C0"><a
href="albums.php?albumname=<?=strval( $row['artist'] );?>"><?=strval( $row['artist'] );?></a> </td>
<td bgcolor="#C0C0C0">276 </td>
</tr>
Re: How to apply color to the table row rather then each cells
Use CSS - this is a lot easier than applying the colors in the HTML and it also keeps the visual formatting separate from the data:
Code:
<style type="text/css">
#mytable {
width: 50%;
}
#mytable td {
background-color: #C0C0C0;
}
#mytable .col1 {
width: 10%;
}
#mytable .col2 {
width: 70%;
}
#mytable .col3 {
width: 20%;
}
</style>
</head>
<body>
<table id="mytable">
<tr>
<td class="col1"><? echo $numbers; ?> </td>
<td class="col2"><a
href="albums.php?albumname=<?=strval( $row['artist'] );?>"><b><?=strval( $row['artist'] );?></b>
</a> </td>
<td class="col3">467 </td>
</tr>
</table>
</body>
</html>
Re: How to apply color to the table row rather then each cells
well if i use style then i can not make the each line diffrent color!! can i ? how?
Re: How to apply color to the table row rather then each cells