ADF(UI)--<af:table>在使用分页是如何固定高度

本文介绍在使用ADF的&lt;af:table&gt;组件时如何解决分页显示中表格高度自适应的问题。当行数不足时,表格高度会变矮,影响页面布局。通过设置inlineStyle的min-height属性可以保持表格的最小高度。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

注:适用ADF11.1.7.0版本


在使用ADF的<af:table>分页时,需设置scrollPolicy="page"的同时也需要设置autoHeightRows="0",但当行数不足预期的行数时,table的高度是会自适应变矮,这对我们预期的页面布局有一定的影响。经测试,发生通过设置inlineStyle的min-height的属性值可以达到预期效果。但官方的帮助文档说不推荐这样做,这样做会导致不兼容问题。原文如下:

Specifying CSS "min-height" and "max-height" values in the "inlineStyle" attribute is not recommended and is incompatible with the autoHeightRows attribute.

但我目前暂没发现不兼容的情况,可能和使用的不同的布局UI有关???

可以使用Python中的pandas库来将XML数据转化为Excel格式,以下是示例代码: ```python import pandas as pd from xml.etree import ElementTree # 读取XML数据 xml_data = '''<?xml version="1.0" encoding="UTF-8"?> <list> <item> <userId>3f2bc360-adc1-4adf-bbd9-092939603af8</userId> <eid>xuyang</eid> <displayName>yang xu</displayName> <type>registered</type> </item> <item> <userId>5d7713fd-8133-40a8-94ad-3a145ed44df8</userId> <eid>yisirui</eid> <displayName>sirui yi</displayName> <type>registered</type> </item> <item> <userId>5dcaf2c0-fb7c-47fe-99bc-df21ede9011b</userId> <eid>xiaosun</eid> <displayName>xuyang sun</displayName> <type>registered</type> </item> <item> <userId>7ea060ff-d6e4-4552-9682-6483eb692a8f</userId> <eid>alex</eid> <displayName>alex Yu</displayName> <type>registered</type> </item> <item> <userId>e190e122-96ef-4b43-9b9e-11a08400c87f</userId> <eid>wanglinkai</eid> <displayName>cui xiai</displayName> <type>registered</type> </item> <item> <userId>e3d6d07e-7a34-47c0-969f-9401ddeab675</userId> <eid>cuikairui</eid> <displayName>kairui cui</displayName> <type>registered</type> </item> <item> <userId>f304a0e1-e0a9-4518-9099-4ef5c2cdb22f</userId> <eid>xuchenxi</eid> <displayName>chenxi xu</displayName> <type>registered</type> </item> </list>''' root = ElementTree.fromstring(xml_data) # 将XML数据转化为DataFrame data = [] for item in root.findall('item'): userId = item.find('userId').text eid = item.find('eid').text displayName = item.find('displayName').text type_ = item.find('type').text data.append([userId, eid, displayName, type_]) df = pd.DataFrame(data, columns=['userId', 'eid', 'displayName', 'type']) # 将DataFrame保存为Excel文件 df.to_excel('data.xlsx', index=False) ``` 运行该代码后,会在当前目录下生成一个名为"data.xlsx"的Excel文件,其中包含了XML数据中的各个字段。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值