Пример с использованием CSS и JS
<html>
<head>
<style>
td
{
border: 1px solid gray;
}
</style>
<script language="javascript">
function onm(th)
{
th.style.border="1px solid red";
}
function outm(th)
{
th.style.border="1px solid gray";
}
</script>
</head>
<body>
<table border="1">
<tr>
<td onmouseover="onm(this)" onmouseout="outm(this)">Text 1</td>
<td onmouseover="onm(this)" onmouseout="outm(this)">Text 2</td>
</tr>
<tr>
<td onmouseover="onm(this)" onmouseout="outm(this)">Text 3</td>
<td onmouseover="onm(this)" onmouseout="outm(this)">Text 4</td>
</tr>
<tr>
<td onmouseover="onm(this)" onmouseout="outm(this)">Text 5</td>
<td onmouseover="onm(this)" onmouseout="outm(this)">Text 6</td>
</tr>
</table>
</body>
</html>
Text 1 |
Text 2 |
Text 3 |
Text 4 |
Text 5 |
Text 6 |
Пример с использованием CSS (не работает в IE)
<html>
<head>
<style>
td
{
border: 1px solid gray;
}
td:hover
{
border: 1px solid red;
}
</style>
</head>
<body>
<table border="1">
<tr>
<td>Text 1</td>
<td>Text 2</td>
</tr>
<tr>
<td>Text 3</td>
<td>Text 4</td>
</tr>
<tr>
<td>Text 5</td>
<td>Text 6</td>
</tr>
</table>
</body>
</html>
Text 1 |
Text 2 |
Text 3 |
Text 4 |
Text 5 |
Text 6 |