How to put DIV between table rows?

I have a table of a long list of information. If one row is clicked on I want to make that perticular one expand with extra stuff/elements without disrupting the display of the other elements:

its hard to explain so I will try to explain it with the HTML below:

<table width="200" border="1">
  <tr id="1">
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr id="2">
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <DIV>EXPANDING UPON ROW 2 AT BLOCK LEVEL But UN-effecting ROW 1 AND 3</DIV>
  <tr id="3">
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>

does anyone know how to do what I want or even know what I am talking about?

Thanks!

You can’t. You’d have to create a new table row and then populate that with a table cell that spans the entire row, then put your DIV in there.

Either that, or split it into two separate tables.

Is this close ?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<title>Title</title>
	<meta http-equiv="content-type" content="text/html;charset=utf-8" />
	<style type="text/css">
	.extra {
		display: none;
	}
	</style>
	<script type="text/javascript">
	function toggleSibling(sibling){
		sibling = sibling.nextSibling;
		while(!/tr/i.test(sibling.nodeName)){
			sibling = sibling.nextSibling;
		}
		sibling.style.display = sibling.style.display == 'table-row' ? 'none' : 'table-row';
	}
	</script>
</head>
<body>
	<table width="200" border="1" id="tb">
  <tr id="a" onclick="toggleSibling(this)">
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr class="extra">
    <td colspan="3">&nbsp;</td>
  </tr>
  <tr id="b" onclick="toggleSibling(this)">
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr class="extra">
    <td colspan="3">&nbsp;</td>
  </tr>
  <tr id="c" onclick="toggleSibling(this)">
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr class="extra">
    <td colspan="3">&nbsp;</td>
  </tr>
</table>
</body>
</html>

@joebert very cool, this worked in FF but not IE7.

I don’t have access to IE7 to test with.

I bet it’s got somthing to do with the use of “table-row” instead of “block” though. Try swapping it out.

why can’t you place <div> inside <tr><td> … </td></tr> and open and close it as much as you like?
Inside <div> can contain another table with rows you need if you like table s so much.

<tr><td>
<div>
<table>

</table>
</div>
</td></tr>

or use nested lists - like navigation - could work better than tables

Why would you want to put a div in the middle of a table. If the div really belongs there then either you have two separate tables (one before and one after the div) or you are using tables incorrectly in the first place.