gpt4 book ai didi

html - 缩小窗口尺寸时,窗口页面中的表格不应有水平滚动条

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

我试过了

<table border="0" cellspacing="0" 
cellpadding="0" height="25" width="100%" style='table-layout:fixed' >

<table border="0" cellspacing="0" 
cellpadding="0" height="25" width="100%" overflow:hidden >

最佳答案

需要指定两个属性,table-layout:fixed on table 和 white-space:nowrap;在细胞上。您还需要移动 overflow:hidden;也对细胞。

table {width:100%; table-layout:fixed;}
td {overflow:hidden; white-space:nowrap;}

您可以使用 overflow-x:hidden 仅在文本溢出时水平隐藏文本。同样 overflow-y:hidden 隐藏垂直滚动条。请记住还要将 table-layout 设置为 fixed 并将 white-space 设置为 no-wrap

关于html - 缩小窗口尺寸时,窗口页面中的表格不应有水平滚动条,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34877212/

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