垂直滚动显示在GridView中(Vertical Scroll to appear in GridView)
我已经尝试了各种方法来获取垂直滚动条,以便在有多行时显示我的GridView。
我试过在GridView周围添加一个DIV,它看起来很糟糕,因为它的填充距离我的GridView 20px。 我有一种方法,当GridView达到其最大高度(200px)时,当数据来自数据库时,GridView将有一个滚动条?
当我这样做时,我也不希望我的Headers和Rows有很高的高度,因为当我尝试为GridView设置高度时,如果有1个数据,它们会变大。
码:
#gv_AcceptedRequests, #gv_PendingRequests, #gv_DeclinedRequests { position:absolute; margin-top: 120px; margin-left: 60px; width: 480px; font-family: Arial; font-size: 12px; border-color: orange; overflow: auto; }
Attempt1:
出于某种原因,DIV不是从数据网格的顶部开始的?
I have tried various ways to get a vertical scroll bar to show for my GridView when there are to many rows.
I have tried adding a DIV around the GridView and it looks horrible as its padding like 20px away from my GridView. I there a way so when the information is coming from the database when the GridView hits its maximum height (200px) the GridView will have a scroll bar?
I also don't want my Headers and Rows to have really big Heights when i do this because when i tried setting a height for my GridView they went bigger if there was on 1 piece of data.
CODE:
#gv_AcceptedRequests, #gv_PendingRequests, #gv_DeclinedRequests { position:absolute; margin-top: 120px; margin-left: 60px; width: 480px; font-family: Arial; font-size: 12px; border-color: orange; overflow: auto; }
Attempt1:
For some reason the DIV isnt startingat the top of the datagrid?
原文:
最满意答案
我相信这应该有用(假设你的字符串位于A1):
=MID(A1, FIND(LEFT(TRIM(A1),1),A1), (LEN(A1)-MATCH(RIGHT(TRIM(A1),1),INDEX(MID(A1,LEN(A1)-ROW(INDIRECT("1:"&LEN(A1)))+1,1),0),0)-FIND(LEFT(TRIM(A1),1),A1)+2)
FIND(LEFT(TRIM(A1),1),A1)
返回字符串中第一个非空格字符的位置
MATCH(RIGHT(TRIM(A1),1),INDEX(MID(A1,LEN(A1)-ROW(INDIRECT("1:"&LEN(A1)))+1,1),0),0)
返回从右到左的字符串中最后一个非空格字符的位置 。I believe this should work (assuming your string is located at A1):
=MID(A1, FIND(LEFT(TRIM(A1),1),A1), (LEN(A1)-MATCH(RIGHT(TRIM(A1),1),INDEX(MID(A1,LEN(A1)-ROW(INDIRECT("1:"&LEN(A1)))+1,1),0),0)-FIND(LEFT(TRIM(A1),1),A1)+2)
FIND(LEFT(TRIM(A1),1),A1)
returns the location of the first non-space character in the string
MATCH(RIGHT(TRIM(A1),1),INDEX(MID(A1,LEN(A1)-ROW(INDIRECT("1:"&LEN(A1)))+1,1),0),0)
returns the location of the last non-space character in the string from right-to-left.
相关问答
更多-
在Python中删除csv文件中的前导和尾随空格(Remove leading and trailing white spaces in a csv file in Python)[2023-08-19]
您可以像这样使用split() , strip()和join() : ','.join([w.strip() for w in my_string.split(',')]) 输出: >>> my_string = '[ a , b,c, hello there ! , my name is +++ , g ]' >>> ','.join([w.strip() for w in my_string.split(',')]) '[ a,b,c,hello there !,my name is ++ ... -
删除前导和尾随空格?(Remove leading and trailing spaces?)[2023-06-18]
您可以使用strip()来删除尾部和前导空格。 >>> s = ' abd cde ' >>> s.strip() 'abd cde' 注意:内部空间被保留 You can use the strip() to remove trailing and leading spaces. >>> s = ' abd cde ' >>> s.strip() 'abd cde' Note: the internal spaces are preserved -
叫做修剪 你想用find_first_not_of拿到第一个非空格字符的索引,然后find_last_not_of摆脱不是空格结束索引。 使用这些,使用substr来获取没有周围空白的子字符串。 在回答您的编辑,我不知道这个词,但我猜沿着“减少”线的东西,所以这就是我把它叫做。 :)(注意,为了灵活性,我将白色空间更改为参数) #include
#include std::string trim(const std::string& str, ... -
如果您想使用公式, TRIM功能将完全符合您的要求: +----+------------+---------------------+ | | A | B | +----+------------+---------------------+ | 1 | =TRIM(B1) | value to trim here | +----+------------+---------------------+ 所以做整列 1)插入一列 2)插入T ...
-
这是我找到的解决方案。 使用html压缩器命令行工具,我只能删除html文件的前导空格,因为完全缩小它们不起作用。 Soultion: java -jar htmlcompressor.jar --preserve-comments --preserve-multi-spaces --preserve-line-breaks --output D:\ html \ foo-leading_spaces.htm D:\ html \ foo.htm 使用此工具生成我想要的结果,我可以将其应用于我的构建脚本,以 ...
-
MongoDB从字符串值中删除空格(前导和尾随)(Removing white spaces (leading and trailing) from string value)[2023-04-06]
MongoDB中的更新目前无法在应用更新时引用当前字段的现有值。 所以你将不得不循环: db.collection.find({},{ "category": 1 }).forEach(function(doc) { doc.category = doc.category.trim(); db.collection.update( { "_id": doc._id }, { "$set": { "category": doc.category } } ); }) ... -
有你提出的所有限制......不 我的建议是只编写一次BeforePost事件,并将所有表链接到相同的beforepost事件。 在objectinspector中 Table1.BeforePost:= TrimFieldsBeforePost; Table2.BeforePost:= TrimFieldsBeforePost; .... 在你的代码中 procedure TMyForm.TrimFieldsBeforePost(DataSet: TDataSet); var i: integer; ...
-
这应该做的伎俩? sed -Ee 's/^[[:space:]]+([0-9]+)[[:space:]]+/\1,/' bob 2,1 word 78,3 other words 2,some other words here 54,bla bla This should do the trick? sed -Ee 's/^[[:space:]]+([0-9]+)[[:space:]]+/\1,/' bob 2,1 word 78,3 other words 2,some other words he ...
-
我相信这应该有用(假设你的字符串位于A1): =MID(A1, FIND(LEFT(TRIM(A1),1),A1), (LEN(A1)-MATCH(RIGHT(TRIM(A1),1),INDEX(MID(A1,LEN(A1)-ROW(INDIRECT("1:"&LEN(A1)))+1,1),0),0)-FIND(LEFT(TRIM(A1),1),A1)+2) FIND(LEFT(TRIM(A1),1),A1)返回字符串中第一个非空格字符的位置 MATCH(RIGHT(TRIM(A1),1),INDEX(MI ...
-
使用String#replace为正则表达式/\s+$/并将文本替换为空字符串。 string.replace(/\s+$/, '') console.log( '-----' + ' test '.replace(/\s+$/, '') + '-----' ) Use String#replace with regex /\s+$/ and replacing text as empty string. string.replace(/\s+$/, '') console.log( ...