[已更新]。我有一個嵌套在另一個工作正常的表,直到有一天它出現在頁面的中間。我檢查了實際的文件,該文件是罰款:表中神祕線突破
<div align="center">
<table width="630" border="0" cellspacing="1" cellpadding="0" style="background-color:white;">
<tr>
<td>
<table width="630" border="1" cellspacing="0" cellpadding="3">
當我查看網頁源代碼,同樣的事情:
<div align="center">
<table width="630" border="0" cellspacing="1" cellpadding="0" style="background-color:white;">
<tr>
<td>
<table width="630" border="1" cellspacing="0" cellpadding="3">
但是,當我檢查的鍍鉻元素,它顯示以下內容:
<div align="center">
<table width="630" border="0" cellspacing="1" cellpadding="0" style="background-color:white;">
<tbody>
<tr>
<td>
<br>
<br>
<br>
<br>
<br>
<br>
<table width="630" border="1" cellspacing="0" cellpadding="3">
該表的完整代碼如下:
<div align="center" class="tabContent" id="imminent">
<br>
<table width="630" border="0" cellspacing="1" cellpadding="0" style="border-collapse:collapse" >
<tr>
<td>
<table width="630" border="0" cellspacing="0" cellpadding="3">
<br>
<div align="center">
<table width="630" border="0" cellspacing="1" cellpadding="0" style="background-color:white;">
<tr>
<td>
<table width="630" border="1" cellspacing="0" cellpadding="3">
<tr>
<td width="65" align="center"><label class="desc" id="title1" for="date">Date</label></font></td>
<td width="20" align="center"><label class="desc" id="title1" for="state">ST</label></font></td>
<td width="195" align="center"><label class="desc" id="title1" for="practice_name">Name</label></font></td>
<td width="70" align="center"><label class="desc" id="title1" for="status">Returned</label></font></td>
<td width="70" align="center"><label class="desc" id="title1" for="progress">Sent Info</label></font></td>
<td width="70" align="center"><label class="desc" id="title1" for="progress">F/U 2</label></font></td>
<td width="70" align="center"><label class="desc" id="title1" for="edit">F/U 3</label></font></td>
<td width="70" align="center"><label class="desc" id="title1" for="edit">F/U 4</label></font></td>
</tr>
<?php
while($rowsim=mysql_fetch_array($resultim)){
$var1im = '<abbr title="Completed on: '.$rowsim['sentdate'].'">'.$rowsim['sentinfo'].'</abbr>';
$var2im = '<abbr title="Completed on: '.$rowsim['follow2date'].'">'.$rowsim['follow2'].'</abbr>';
$var3im = '<abbr title="Completed on: '.$rowsim['follow3date'].'">'.$rowsim['follow3'].'</abbr>';
$var4im = '<abbr title="Completed on: '.$rowsim['follow4date'].'">'.$rowsim['follow4'].'</abbr>'; }
?>
<tr>
<td width="65"> <? echo $rowsim['date']; ?></td>
<td width="20"> <? echo $rowsim['state']; ?></td>
<td width="195">
<a href="webleads.php?id=<? echo $rowsim['id'];?>"> <? if($rowsim['name']!="") {echo $rowsim['name']; } else { echo $rowsim['office']; }?></a></td>
<td width="70"> <? echo $rowsim['returned']; ?></td>
<td width="70"> <? echo $var1im; ?></td>
<td width="70"> <? echo $var2im; ?></td>
<td width="70"> <? echo $var3im; ?></td>
<td width="70"> <? echo $var4im; ?></td><br>
</tr>
<? } ?>
</table>
</td>
</tr>
</table>
<br />
</div>
</table>
</table>
</div>
只有Javascript代碼我正在使用的是製作標籤頁。工作了很長一段時間,直到發生這種情況。
<script type="text/javascript">
//<![CDATA[
var tabLinks = new Array();
var contentDivs = new Array();
function init() {
// Grab the tab links and content divs from the page
var tabListItems = document.getElementById('tabs').childNodes;
for (var i = 0; i < tabListItems.length; i++) {
if (tabListItems[i].nodeName == "LI") {
var tabLink = getFirstChildWithTagName(tabListItems[i], 'A');
var id = getHash(tabLink.getAttribute('href'));
tabLinks[id] = tabLink;
contentDivs[id] = document.getElementById(id);
}
}
// Assign onclick events to the tab links, and
// highlight the first tab
var i = 0;
for (var id in tabLinks) {
tabLinks[id].onclick = showTab;
tabLinks[id].onfocus = function() { this.blur() };
if (i == 0) tabLinks[id].className = 'selected';
i++;
}
// Hide all content divs except the first
var i = 0;
for (var id in contentDivs) {
if (i != 0) contentDivs[id].className = 'tabContent hide';
i++;
}
}
function showTab() {
var selectedId = getHash(this.getAttribute('href'));
// Highlight the selected tab, and dim all others.
// Also show the selected content div, and hide all others.
for (var id in contentDivs) {
if (id == selectedId) {
tabLinks[id].className = 'selected';
contentDivs[id].className = 'tabContent';
} else {
tabLinks[id].className = '';
contentDivs[id].className = 'tabContent hide';
}
}
// Stop the browser following the link
return false;
}
function getFirstChildWithTagName(element, tagName) {
for (var i = 0; i < element.childNodes.length; i++) {
if (element.childNodes[i].nodeName == tagName) return element.childNodes[i];
}
}
function getHash(url) {
var hashPos = url.lastIndexOf ('#');
return url.substring(hashPos + 1);
}
//]]>
</script>
您的HTML格式爲_quite_無效。所有結束標籤在哪裏? –
發佈您的JavaScript代碼。
可能會從某些客戶端腳本添加。 –
這只是開放標籤(僅限問題所在)。我會補充剩下的。 – user2727128