gpt4 book ai didi

html - 无法更改 div 中表格的列/行高度

转载 作者:行者123 更新时间:2023-11-28 10:34:56 27 4
gpt4 key购买 nike

我正在使用我的Vertical_Table 函数 生成一个表格。当我从 div 中删除表格时,我可以调整行和列的尺寸,但是当它位于 div 中时,我无法更改它们。任何想法为什么?这是一些 jfiddle,所以你可以看到我在说什么 http://jsfiddle.net/6XAHR/

CSS 代码

> #Pallate
{
border: 1px solid black;
position:relative;
top:40px;
margin:0 auto;
width:1200px;
height:360px;
background-color: #C8C8C8;
}

#Scroll_Table_Border
{
Position:relative;
top:40px;
Left:320px;
border: 1px solid black;
height:275px;
max-width: 850px;
background-color: #C8C8C8;
}

#Scroll_Table {
left:25px;
top:25px;
white-space: nowrap;
Position:Absolute;
height:225px;
max-width: 800px;
width: 100% !important;
overflow:auto;
background-color: #C8C8C8;
}

#Button_Group_Title
{
Position:Absolute;
padding-right:5px;
padding-left:5px;
background-color: #C8C8C8;
top:30px;
Left:35px;
z-index:2;
}
#Scroll_Table_Title
{
Position:Absolute;
padding-right:5px;
padding-left:5px;
background-color: #C8C8C8;
z-index:2;
top:30px;
Left:335px;
}


#Button_Group {
text-align:center;
padding-top:30px;
padding-bottom:15px;
padding-right:25px;
padding-left:25px;
border: 1px solid black;
position:Absolute;
top:40px;
left:20px;
height:230px;
width:200px;
vertical-align: middle;
background-color: #C8C8C8;
}

HTML 代码

<div ID = "Pallate" >
<div ID = "Scroll_Table_Title">Trial Information</div>
<div ID = "Button_Group_Title">View Results</div>

<div ID = "Button_Group">
<input type="button" ID = "Paper_Information" onclick="changeContent(this.id)" value="Paper Information" class = "Class_Button">
<input type="button" ID = "Trial_Information" onclick="changeContent(this.id)" value="Trial Setting" class = "Class_Button">
<input type="button" ID = "Results" onclick="changeContent(this.id)" value="Trial Results" class = "Class_Button">
<input type="button" ID = "Control_Law" onclick="changeContent(this.id)" value="Control Algorithm" class = "Class_Button">
<input type="button" ID = "Exercise" onclick="changeContent(this.id)" value="Exercise" class = "Class_Button">
<input type="button" ID = "Actuator" onclick="changeContent(this.id)" value="Pump Properties" class = "Class_Button">
<input type="button" ID = "Sensor" onclick="changeContent(this.id)" value="Glucose Sensor" class = "Class_Button">
<input type="button" ID = "Blood_Glucose_Safety" onclick="changeContent(this.id)" value="Blood Glucose Safety" class = "Class_Button">
<input type="button" ID = "Reference_Glucose" onclick="changeContent(this.id)" value="Reference Measurements" class = "Class_Button">
</div>

PHP 代码

 <div ID = "Scroll_Table_Border">
<div ID = "Scroll_Table">
<?php
$Columns = 'SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE Table_NAME = \'Control_Law\'';
$Columns = sqlsrv_query($dbhandle,$Columns);
$Sets = array(sqlsrv_query($dbhandle, 'SELECT * FROM Control_Law WHERE [Paper ID] = ' . $ID));

$i = 0;
while ($Row = sqlsrv_fetch_array($Columns))
{
$Column_Vector[$i] = $Row[0]; $i++;
}
$Table_ID = 'Advanced_Table';
$Columns_Vector = array($Column_Vector);
Vertical_Table($Columns_Vector,$Sets,'40px','',$Table_ID);
?>
</div>
</div>

最佳答案

 #Scroll_Table {
left:25px;
top:25px;
white-space: nowrap; //REMOVE THIS
Position:Absolute;
height:225px;
max-width: 800px;
width: 100% !important;
overflow:auto;
background-color: #C8C8C8;
}

这将使它下拉,然后您可以设置最大宽度。您现在拥有的文本的问题是它全是 1 个字符串,没有空格。删除空格,它会正常下降。希望这对您有所帮助!

关于html - 无法更改 div 中表格的列/行高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23376939/

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