valign="middle"与align="center"的区别

本文详细介绍了HTML表格中内容的对齐方式,包括垂直对齐(valign)和水平对齐(align)属性的使用方法及其取值含义。通过本文,读者可以了解如何设置表格中的文本或元素在垂直方向(top、middle、bottom)和水平方向(LEFT、CENTER、RIGHT)的位置。

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

在<td>标签中valign="middle"与align="center"不相同。


valign 调格子中内容的垂向(上下)位置,valign=“top“上面,  valign=“middle“中间,或 valign=“bottom 下面。

align 调格子中内容的(左右)横向位置,align="LEFT“ 左边对齐, align="CENTER“中间 或 align="RIGHT“右边对齐。

valign -- vertical alignment  的缩写。
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <ureport xmlns="http://www.j2eefast.com/JUUreport" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.j2eefast.com/JUUreport http://www.j2eefast.com/JUUreport "> <config> <name><![CDATA[资产标签打印]]></name> <downName><![CDATA[资产标签]]></downName> <func><![CDATA[_ALL]]></func> <roleKeys><![CDATA[_ALL]]></roleKeys> <tableAlias><![CDATA[,,]]></tableAlias> <remark><![CDATA[打印资产标签]]></remark> <version><![CDATA[V2.1-2022-06-01]]></version> </config> <cell col="1" expand="Down" name="A1" row="1"> <cell-style align="center" font-family="宋体" font-size="9" forecolor="0,0,0" valign="middle" wrap-compute="true"/> <dataset-value aggregate="select" dataset-name="assetList" mapping-type="simple" order="none" property="asset_id"/> </cell> <cell col="2" expand="None" name="B1" row="1"> <cell-style align="center" font-family="宋体" font-size="9" forecolor="0,0,0" valign="middle"/> <simple-value/> </cell> <cell col="3" expand="None" name="C1" row="1"> <cell-style align="center" font-family="宋体" font-size="9" forecolor="0,0,0" valign="middle"/> <simple-value/> </cell> <cell col="1" col-span="3" expand="None" left-cell="A1" name="A2" row="2"> <cell-style align="center" font-family="宋体" font-size="9" forecolor="0,0,0" valign="middle"> <left-border color="0,0,0" style="solid" width="1"/> <right-border color="0,0,0" style="solid" width="1"/> <top-border color="0,0,0" style="solid" width="1"/> <bottom-border color="0,0,0" style="solid" width="1"/> </cell-style> <image-value height="60" source="text" width="260"> <text><![CDATA[/xdfz1.png]]></text> </image-value> </cell> <cell col="1" expand="None" left-cell="A1" name="A3" row="3"> <cell-style align="center" bold="false" font-size="10" forecolor="0,0,0" line-height="2" valign="middle"> <left-border color="0,0,0" style="solid" width="1"/> <right-border color="0,0,0" style="solid" width="1"/> <top-border color="0,0,0" style="solid" width="1"/> <bottom-border color="0,0,0" style="solid" width="1"/> </cell-style> <simple-value><![CDATA[单位]]></simple-value> </cell> <cell col="2" col-span="2" expand="None" left-cell="A1" name="B3" row="3"> <cell-style align="center" bold="false" font-family="宋体" font-size="10" forecolor="0,0,0" valign="middle"> <left-border color="0,0,0" style="solid" width="1"/> <right-border color="0,0,0" style="solid" width="1"/> <top-border color="0,0,0" style="solid" width="1"/> <bottom-border color="0,0,0" style="solid" width="1"/> </cell-style> <simple-value><![CDATA[0602 附属中学]]></simple-value> </cell> <cell col="1" expand="None" left-cell="A1" name="A4" row="4"> <cell-style align="center" bold="false" font-size="10" forecolor="0,0,0" line-height="2" valign="middle"> <left-border color="0,0,0" style="solid" width="1"/> <right-border color="0,0,0" style="solid" width="1"/> <top-border color="0,0,0" style="solid" width="1"/> <bottom-border color="0,0,0" style="solid" width="1"/> </cell-style> <simple-value><![CDATA[名称]]></simple-value> </cell> <cell col="2" col-span="2" expand="None" left-cell="A1" name="B4" row="4"> <cell-style align="center" bold="false" font-family="宋体" font-size="10" forecolor="0,0,0" line-height="2" valign="middle"> <left-border color="0,0,0" style="solid" width="1"/> <right-border color="0,0,0" style="solid" width="1"/> <top-border color="0,0,0" style="solid" width="1"/> <bottom-border color="0,0,0" style="solid" width="1"/> </cell-style> <dataset-value aggregate="group" dataset-name="assetList" mapping-type="simple" order="none" property="asset_name"/> </cell> <cell col="1" expand="None" left-cell="A1" name="A5" row="5"> <cell-style align="center" bold="false" font-family="宋体" font-size="9" forecolor="0,0,0" line-height="2" valign="middle"> <left-border color="0,0,0" style="solid" width="1"/> <right-border color="0,0,0" style="solid" width="1"/> <top-border color="0,0,0" style="solid" width="1"/> <bottom-border color="0,0,0" style="solid" width="1"/> </cell-style> <simple-value><![CDATA[规格]]></simple-value> </cell> <cell col="2" expand="None" left-cell="A1" name="B5" row="5"> <cell-style align="center" font-family="宋体" font-size="9" forecolor="0,0,0" valign="middle"> <left-border color="0,0,0" style="solid" width="1"/> <right-border color="0,0,0" style="solid" width="1"/> <top-border color="0,0,0" style="solid" width="1"/> <bottom-border color="0,0,0" style="solid" width="1"/> </cell-style> <dataset-value aggregate="group" dataset-name="assetList" mapping-type="simple" order="none" property="specification"/> </cell> <cell col="3" expand="None" left-cell="A1" name="C5" row="5" row-span="2"> <cell-style align="center" font-family="宋体" font-size="9" forecolor="0,0,0" valign="middle"> <left-border color="0,0,0" style="solid" width="1"/> <right-border color="0,0,0" style="solid" width="1"/> <top-border color="0,0,0" style="solid" width="1"/> <bottom-border color="0,0,0" style="solid" width="1"/> </cell-style> <zxing-value category="qrcode" height="85" source="expression" width="103"> <text><![CDATA[B6]]></text> </zxing-value> </cell> <cell col="1" expand="None" left-cell="A1" name="A6" row="6"> <cell-style align="center" bold="false" font-family="宋体" font-size="9" forecolor="0,0,0" line-height="2" valign="middle"> <left-border color="0,0,0" style="solid" width="1"/> <right-border color="0,0,0" style="solid" width="1"/> <top-border color="0,0,0" style="solid" width="1"/> <bottom-border color="0,0,0" style="solid" width="1"/> </cell-style> <simple-value><![CDATA[编号]]></simple-value> </cell> <cell col="2" expand="None" left-cell="A1" name="B6" row="6"> <cell-style align="center" font-family="宋体" font-size="9" forecolor="0,0,0" valign="middle"> <left-border color="0,0,0" style="solid" width="1"/> <right-border color="0,0,0" style="solid" width="1"/> <top-border color="0,0,0" style="solid" width="1"/> <bottom-border color="0,0,0" style="solid" width="1"/> </cell-style> <dataset-value aggregate="group" dataset-name="assetList" mapping-type="simple" order="none" property="asset_code"/> </cell> <row height="7" row-number="1"/> <row height="41" row-number="2"/> <row height="31" row-number="3"/> <row height="32" row-number="4"/> <row height="33" row-number="5"/> <row height="33" row-number="6"/> <column col-number="1" width="77"/> <column col-number="2" width="80"/> <column col-number="3" width="80"/> <datasource name="MASTER" type="buildin"> <dataset ispage="false" name="assetList" type="sql"> <sql><![CDATA[select asset_id, asset_name, asset_code, specification from am_asset where FIND_IN_SET(asset_id,:asset_ids)]]></sql> <field name="asset_id"/> <field name="asset_name"/> <field name="asset_code"/> <field name="specification"/> <parameter default-value="1912707435423539202,1912706746542661634" name="asset_ids" type="String"/> </dataset> </datasource> <paper bg-image="" bg-watermark="" bottom-margin="72" column-enabled="false" fixrows="0" height="842" html-interval-refresh-value="0" html-report-align="center" left-margin="90" orientation="portrait" paging-mode="fitpage" right-margin="90" top-margin="72" type="A4" width="595"/> </ureport> 这是ureport的xml
最新发布
07-04
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值