gpt4 book ai didi

jquery - html表格列大小调整

转载 作者:行者123 更新时间:2023-11-28 11:22:09 25 4
gpt4 key购买 nike

我正在尝试创建一个简单的 html 表格(一行到一列)。我希望一列溢出滚动条。问题是无论我更改什么 css setitngs,列大小都会根据文本变化,并且滚动条是水平的而不是垂直的。需要更改哪些内容才能使我的表格成为我想要的样子?

HTML代码:

<table class="homepage_table">
<tr >
<td id="Articlesbar" width="20%" >
<%@include file="newsData.jsp" %>

</td>


<td id="about_td" width="80%" >
<div class="fadein">
<img src="imp.gif">
<img src="http://thefinancialbrand.com/wp-content/uploads/2008/08/tagline-tagcloud.gif">
<img src="slogan1.gif">

</div>

<div id="about_text" width="100%" height= "100px" >
Founded in 1992 as a Finance and Securities Company,
Imperia Bank converted into a fully fledged commercial bank in January 1996.
Since then the bank has had a long standing tradition of achieving strong financial performance and carrying out
expansion strategies while successfully focusing on efficient client service delivery.<br><br>
Over the last 20 years, Imperia Bank has achieved a sustained growth in our customer deposit base which is largely attributed to the level of confidence our customers have in the bank and our corporate strategy.
Currently we have 23 branches in our expanding branch network across major towns and cities.<br><br>
Imperial Bank will continue to enhance the existing risk management parameters through the effective use of our newly installed and cutting edge core banking system.
As part of our growth strategy, we are also continuing to recruit qualified professional staff, and providing appropriate training to our existing human resources to ensure we continue to meet evolving customer demands.
</div>
</td>
</tr>
</table>

还有(从 jsp 页面导入):

    <div id= "newsHeader"><%=header %></div>
<div id = "newsBody"><%=newsBody %></div>
<div id = "newsDate"><%=date %></div>

<br>

CSS 代码:

.homepage_table
{
border: 250;
width: 100%;
height:500px;
margin:auto;
}
.homepage_table td
{
border:solid;

}
#about_td
{
background-image:url('http://www.promenadd.com/en/wp-content/uploads/2013/04/promenadd_grey_background.jpg');
background-repeat:no-repeat;
background-size: 110%;
font-family: "Avant Garde", Avantgarde, "Century Gothic", CenturyGothic, "AppleGothic", sans-serif;
font-weight:bold;

}
#about_text
{

padding-right: 50px;
padding-left: 50px;
color:steelblue;


}
#Articlesbar
{

overflow-x: hidden;
overflow-y: scroll;
}

#newsHeader
{
font-family: "Avant Garde", Avantgarde, "Century Gothic", CenturyGothic, "AppleGothic", sans-serif;
color:steelblue;
font-weight:bold;
font-size: 20px;
padding-right: 10px;
padding-left: 10px;
}

#newsBody
{
font-family: "Avant Garde", Avantgarde, "Century Gothic", CenturyGothic, "AppleGothic", sans-serif;
color:red;
font-size: 14px;
padding-right: 10px;
padding-left: 10px;
}
#newsDate
{
font-family: "Avant Garde", Avantgarde, "Century Gothic", CenturyGothic, "AppleGothic", sans-serif;
font-size: 14px;
padding-right: 10px;
padding-left: 10px;
}

最佳答案

我被打败了,但看起来发帖者想要 Articlesbar 上的滚动条

所以简单的方法是在那个 td 上设置一个高度,在其中添加一个 div,然后向其中添加滚动条。

结构是这样的

<table>
<tr>
<td>
<div>
</div>
</td>
</tr>
</table>

here have a fiddle

关于jquery - html表格列大小调整,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21487425/

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