gpt4 book ai didi

html - Div 内的表格 - 不是 Div 元素的 100% 宽度

转载 作者:太空宇宙 更新时间:2023-11-03 19:04:14 25 4
gpt4 key购买 nike

我无法让 div 中的表格始终占 div 内部的 100%,而且看起来内部表格在 div 中的大小始终不同。也许我在使用内部表格时混淆了水域,但我确实有一堆格式可以尝试正确显示。希望它在任一浏览器等中都一样。

感谢任何帮助。

下面的大部分代码。

Overflow Here - 在表格内使用 width=100% 时

<script language="javascript"> 
function one_edit() {
var ele = document.getElementById("one_edit");
var text = document.getElementById("one_displayedit");
if(ele.style.display == "block") {
ele.style.display = "none";
text.innerHTML = "<b>ONE</b>";
}
else {
ele.style.display = "block";
text.innerHTML = "<b>ONE</b>";
}
}
</script>
<script language="javascript">
function two_edit() {
var ele = document.getElementById("two_edit");
var text = document.getElementById("two_displayedit");
if(ele.style.display == "block") {
ele.style.display = "none";
text.innerHTML = "<b>TWO</b>";
}
else {
ele.style.display = "block";
text.innerHTML = "<b>TWO</b>";
}
}
</script>


<style type="text/css">

.flist {
font-family: Verdana; font-size: 13pt; font-weight: bold;
overflow: hidden;
position: relative;
background-color: #e9e9e9;
padding: 5px;
margin-top: 5px;
margin-left: 21%;
margin-right: 21%;
border: 1px solid #000;
}

.flist > table
{
width: 100%;
}

.fqlist {
font-family: Verdana; font-size: 12pt; font-weight: normal;
position: relative;
background-color: #f8f8f8;
padding: 5px;
margin-bottom: 5px;
margin-left: 21%;
margin-right: 21%;
border-left: 1px solid #000;
border-right: 1px solid #000;
border-bottom: 1px solid #000;
}

.code10 { font-family: Verdana; font-size: 10pt; font-weight: normal; color: #cc0033;}

.instable {
margin-bottom: 8px;
border: 1px solid #474747;
background-color: #eeeeee;
}

</style>


<div class=flist>
<table cellpadding=2 border=0 style="table-layout:fixed">
<tr>
<td valign=middle>
<a id="one_displayedit" href="javascript:one_edit();"><b>ONE</b></a>
</td>
<td align=right><input type="button" name="CheckAll" value="All N/A" class=verd8 onClick="checkAll(one_)"></td>
</tr>
</table>
</div>

<div id="one_edit" style="display: none" class=fqlist>

<table cellpadding=3 cellspacing=3 align=center class=instable>
<tr>
<td align=center><input type="button" name="CheckAll" value="All Yes" class=verd8 onClick="checkAll(one_yes)"></td>
<td align=center><input type="button" name="CheckAll" value="All No" class=verd8 onClick="checkAll(one_no)"></td>
<td align=center><input type="button" name="CheckAll" value="All N/A" class=verd8 onClick="checkAll(one_)"></td>
</tr>
</table>

<table cellpadding=3 cellspacing=3 align=center class=instable>
<tr>
<td valign=top colspan=3 align=center>
This is a General Question for whatever.
</td>
</tr>

<tr>
<td colspan=3 align=center>
Some General Notes
</td>
</tr>

<tr>

<td align=center class=verd11><b>Yes</b></td>
<td align=center class=verd11><b>No</b></td>
<td align=center class=verd11><b>N/A</b></td>
</tr>

<tr>
<td valign=top colspan=3 align=center>
<span class=code10>General Notes About Question Rules.</span>
</td>
</tr>

<tr>
<td colspan=3 align=center class=cnote width=100%>
<b>Compliance Note:
<br>
<textarea style="width:85%" rows="3" name="compliancenote_#qid#"></textarea>
<br>
</td>
</tr>
</table>

</div>

<div class=flist>
<table cellpadding=2 border=0 style="table-layout:fixed">
<tr>
<td valign=middle>
<a id="two_displayedit" href="javascript:two_edit();"><b>Two</b></a>
</td>
<td align=right><input type="button" name="CheckAll" value="All N/A" class=verd8 onClick="checkAll(two_)"></td>
</tr>
</table>
</div>

<div id="two_edit" style="display: none" class=fqlist>

<table cellpadding=3 cellspacing=3 align=center class=instable>
<tr>
<td align=center><input type="button" name="CheckAll" value="All Yes" class=verd8 onClick="checkAll(two_yes)"></td>
<td align=center><input type="button" name="CheckAll" value="All No" class=verd8 onClick="checkAll(two_no)"></td>
<td align=center><input type="button" name="CheckAll" value="All N/A" class=verd8 onClick="checkAll(two_)"></td>
</tr>
</table>

<table cellpadding=3 cellspacing=3 align=center class=instable>
<tr>
<td valign=top colspan=3 align=center>
This is a General Question for whatever and is bigger than the other question, and I am trying to keep going to make it bigger and longer.
So not sure how to get these showing as same width across entire div length.
</td>
</tr>

<tr>
<td colspan=3 align=center>
Some General Notes
</td>
</tr>

<tr>

<td align=center class=verd11><b>Yes</b></td>
<td align=center class=verd11><b>No</b></td>
<td align=center class=verd11><b>N/A</b></td>
</tr>

<tr>
<td valign=top colspan=3 align=center>
<span class=code10>General Notes About Question Rules.</span>
</td>
</tr>

<tr>
<td colspan=3 align=center class=cnote width=100%>
<b>Compliance Note:
<br>
<textarea style="width:85%" rows="3" name="compliancenote_#qid#"></textarea>
<br>
</td>
</tr>
</table>

</div>

最佳答案

您似乎没有将 width:100%; 应用于溢出的表格。尝试这样做(我相信溢出的表是 .instable):

.instable {
width:100%;
}

也尝试在不同的浏览器中查看它是否有效。我使用的是 Chrome,表格甚至没有填满整个 div

关于html - Div 内的表格 - 不是 Div 元素的 100% 宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10932177/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com