PDA

View Full Version : expanding table



bernie1227
05-21-2012, 09:31 AM
hiya guys,
I was wondering if there was a way in which you could have rows on a table made with html that are hidden when the page loads but when you clicked on the row above, it would expand out the previously hidden content below it. Any idea how to do that?
thanks,
bernie

keyboard
05-21-2012, 09:35 AM
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function showTable() {
document.getElementById('showMe').style.display = "block";
}
</script>
</head>
<body>
<table border="1">
<tr onclick="showTable()">
<td>Text 1</td>
<td>Text 2</td>
</tr>
<tr style="display:none;" id="showMe">
<td>Text 3</td>
<td>Text 4</td>
</tr>
</table>
</body>
</html>