• 0

HTML table help


Question

davemania

I was wondering how table rows that only have top and bottom borders and table rows that are highlighted when the mouse is placed over them are achieved ? Can someone point me to a good tutorial.

thanks

Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0
Andrew179

This code should work in most, if not all browsers that support javascript and css.

<html>
<head>
<title>Table Example</title>
<style>
td {border-top:1px solid black;
	}
#lastrow td {border-bottom:1px solid black;}
</style>
</head>

<body>
<table width="50%" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#dddddd" onMouseOver="this.bgColor='yellow'" onMouseOut="this.bgColor='#dddddd'">
          <td>Cell 1</td>
          <td>Cell 2</td>
          <td>Cell 3</td>
        </tr>
<tr bgcolor="#dddddd" onMouseOver="this.bgColor='yellow'" onMouseOut="this.bgColor='#dddddd'" id="lastrow">
          <td>Cell 1</td>
          <td>Cell 2</td>
          <td>Cell 3</td>
        </tr>
</table>
</body>
</html>

For good html and css tutorials, let me refer you to the W3 Schools.

Link to post
Share on other sites
This topic is now closed to further replies.
  • Recently Browsing   0 members

    No registered users viewing this page.