To edit the current code one basic step is to organize your code. The tab Key has a key role on this.
See this code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title></title>
<style type="text/css">
table,td{border: 1px solid #ff00ff; border-collapse: collapse}
</style></head><body>
<table><tr>
<td>a</td><td>b</td><td>c</td></tr>
<tr>
<td>d</td><td>e</td><td>f</td>
</tr></table></body></html>
Is the same than this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<style type="text/css">
table, td{
border: 1px solid #ff00ff;
border-collapse: collapse
}
</style>
</head>
<body>
<table>
<tr>
<td>a</td><td>b</td><td>c</td>
</tr>
<tr>
<td>d</td><td>e</td><td>f</td>
</tr>
</table>
</body>
</html>
but now it is grouped by elements. To find where an element starts or finishes look for the closing tag:
<body> <!--body begins-->
</body> <!--body ends-->
Other elements doesn't have a closing tag. xhtml and good programing practices stand against leaving open tags so you should add the "/" at the end of such tags: