我不知道為什么我的內表會忽略列的寬度。 內表的所有列最終都是一樣的寬度。如果有任何幫助或建議,我將不勝感激。 寬度是根據回傳的列的數量和型別生成的。
外表有幾百行,而每個內表將有50到100行。 我可能會在將來添加某種過濾器來限制外表的行數,以提高性能。 我不擅長html,對CSS和JavaScript也只有粗淺的了解,但從我讀到的所有內容來看,這應該是可行的。
我查看了 chrome 開發者工具中的元素,看看我是否能夠弄清楚外表的寬度是如何作業的,但我沒有看到它從colgroup中獲取寬度的地方,所以這似乎是一個死胡同。 我可能對某些事情有基本的誤解。
<! DOCTYPE html>
<html>
<head>
<style>
th {
text-align: left;
}
.change {
background-color: gold ;
}
</style>>
</head>
<body>
< form action="" method="POST">
<h2>標題</h2>
<table id="tableID">
<colgroup>/span>
<col width='5%'/span> />
<col width='15%'/span> />/span>
<col width='10%' />/span>
<col width='70%' />/span>
</colgroup>
<thead>/span>
<tr>/span>
<th width='2%'/span>> Flag</th>。
<th>/span>Name</th>
<th>Key</th>/span>
<th>Children</th>
</tr>/span>
</thead>/span>
<tbody>/span>
<tr>/span>
<td>< input type='checkbox'/span> checked value='Y'/span> /> </td>>
<td>< input type='text' value='Activity' /> </td>>
<td>< input type='text'/span> value='UNQ' class='change' /> </td>>
<td>
<details width='100%'/span>>/span>
<summary>Children</summary>
<table width='100%'/span>>
<colgroup>/span>
<col width='5%'/span> />
<col width='5%'/span> />/span>
<col width='10%'/span> />
<col width='5%'/span> />/span>
<col width='5%'/span> />/span>
<col width='80%'/span> />
</colgroup>
<thead>/span>
<tr>/span>
<th>/span>Flag</th>/span>
<th>/span>Seq</th>/span>
<th>/span>Name</th>/span>
<th>Key</th>/span>
<th>強制性</th>/span>
<th>Parent</th>
<th>/span>Desc</th>/span>
</tr>/span>
</thead>/span>
<tbody>/span>
<tr>/span>
<td>< input type='text' value='N' /> </td>>
<td>< input type='text' value='1' /> </td>>
<td>< input type='text' value='AddBy' /> </td>>
<td>< input type='text' value='N' /> </td>>
<td>< input type='text'/span> value='N' class='change' /> </td>>
<td>< input type='text' value='N' /> </td>>
<td>< input type='text' value='Add By' /> </td>>
</tr>/span>
</tbody>/span>
</table>/span>
</details>
</td>/span>
</tr>/span>
</tbody>/span>
</table>/span>
< input type="submit" value="submit" />
</form>
</html>
uj5u.com熱心網友回復:
你的嵌入式表格顯示所有列的寬度都是一樣的,并不是因為它是一個嵌入式表格,而是因為它的單元格包含了沒有指定寬度的input元素。由于缺乏規范,它們采用的是網頁瀏覽器的默認樣式規范。為了使您的表格單元格與您指定的列寬相匹配,您可以添加以下CSS。根據你的網頁上其他input元素的背景關系,你可能想使用一個更具體的選擇器。
input {
width: 100%;
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/331817.html
標籤:
上一篇:我怎樣才能改變軟體包的名稱
