table-cell布局

本文探讨了CSS中table-cell布局的应用,通过实例展示了如何均分宽度。同时,分析了浮动元素(float:right)对布局的影响,分别讨论了浮动在不同元素上的效果,并指出修改text-align属性也可实现类似效果。

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

参考:https://blog.youkuaiyun.com/messagebox_/article/details/82380913
html:

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <title>dddd</title>
    <link rel="stylesheet" type="text/css" href="follow2.css" />
</head>

<body>
    <div>
        <div class="div1">
            <img src="img/open_live.png" class="icon" />
        </div>
        <div class="div2">
            <img src="img/open_live.png" class="icon" />
        </div>
        <div class="div3">
            <img src="img/open_live.png" class="icon3" />
        </div>
</body>

</html>

css

body {
    padding: 0px;
    margin: 0px;
}

div {
    height: 98px;
    background-color: gray;
    display: table;
内容过长自动换行, <xsl:template match=“TableReport”> <fo:block > <fo:table text-align="left" border-collapse="collapse" letter-spacing="1px" width="100%" border-width="1pt" font-size="2.6mm"> <fo:table-column border-width="0pt" column-width="0.7cm"/> <fo:table-column border-width="0pt" column-width="0.8cm"/> <fo:table-column border-width="0pt" column-width="2.5cm"/> <fo:table-column border-width="0pt" column-width="1.5cm"/> <fo:table-column border-width="0pt" column-width="1cm"/> <fo:table-column border-width="0pt" column-width="1.6cm"/> <fo:table-column border-width="0pt" column-width="1.6cm"/> <fo:table-column border-width="0pt" column-width="3cm"/> <fo:table-column border-width="0pt" column-width="4.7cm"/> <fo:table-column border-width="0pt" column-width="0.8cm"/> <fo:table-column border-width="0pt" column-width="1.1cm"/> <fo:table-header> <fo:table-row height="5mm"> <fo:table-cell xsl:use-attribute-sets="border-cell-left-style"> <fo:block text-align="center">序号</fo:block> </fo:table-cell> <fo:table-cell xsl:use-attribute-sets="border-cell-left-style"> <fo:block text-align="center">组织</fo:block> </fo:table-cell> <fo:table-cell xsl:use-attribute-sets="border-cell-left-style"> <fo:block text-align="center">申请单号</fo:block> </fo:table-cell> <fo:table-cell xsl:use-attribute-sets="border-cell-left-style"> <fo:block text-align="center">类型</fo:block> </fo:table-cell> <fo:table-cell xsl:use-attribute-sets="border-cell-left-style"> <fo:block text-align="center">状态</fo:block> </fo:table-cell> <fo:table-cell xsl:use-attribute-sets="border-cell-style"> <fo:block text-align="center">工号</fo:block> </fo:table-cell> <fo:table-cell xsl:use-attribute-sets="border-cell-style"> <fo:block text-align="center">姓名</fo:block> </fo:table-cell> <fo:table-cell xsl:use-attribute-sets="border-cell-style"> <fo:block text-align="center">物料编码</fo:block> </fo:table-cell> <fo:table-cell xsl:use-attribute-sets="border-cell-style"> <fo:block text-align="center">物料描述</fo:block> </fo:table-cell> <fo:table-cell xsl:use-attribute-sets="border-cell-style"> <fo:block text-align="center">销数</fo:block> </fo:table-cell> <fo:table-cell xsl:use-attribute-sets="border-cell-style"> <fo:block text-align="center">原数量</fo:block> </fo:table-cell> </fo:table-row> </fo:table-header> <!--表明细--> <fo:table-body> <xsl:apply-templates select="TableRow"/> </fo:table-body> </fo:table> </fo:block> <fo:block id="end"/> </xsl:template> <xsl:template match="TableRow"> <fo:table-row height="5mm"> <fo:table-cell xsl:use-attribute-sets="border-cell-left-style"> <fo:block><xsl:value-of select="no"/></fo:block> </fo:table-cell> <fo:table-cell xsl:use-attribute-sets="border-cell-left-style"> <fo:block><xsl:value-of select="orgCode"/></fo:block> </fo:table-cell> <fo:table-cell xsl:use-attribute-sets="border-cell-left-style" font-size="2.2mm"> <fo:block><xsl:value-of select="requestNo"/></fo:block> </fo:table-cell> <fo:table-cell xsl:use-attribute-sets="border-cell-left-style"> <fo:block><xsl:value-of select="noteType"/></fo:block> </fo:table-cell> <fo:table-cell xsl:use-attribute-sets="border-cell-left-style"> <fo:block><xsl:value-of select="state"/></fo:block> </fo:table-cell> <fo:table-cell xsl:use-attribute-sets="border-cell-style"> <fo:block><xsl:value-of select="empNo"/></fo:block> </fo:table-cell> <fo:table-cell xsl:use-attribute-sets="border-cell-style" font-size="2.2mm"> <fo:block><xsl:value-of select="empName"/></fo:block> </fo:table-cell> <fo:table-cell xsl:use-attribute-sets="border-cell-style" font-size="2.2mm"> <fo:block><xsl:value-of select="itemCode"/></fo:block> </fo:table-cell> <fo:table-cell xsl:use-attribute-sets="border-cell-style" font-size="2.2mm"> <fo:block wrap-option="wrap" language="zh"><xsl:value-of select="itemDesc"/></fo:block> </fo:table-cell> <fo:table-cell xsl:use-attribute-sets="border-cell-style" font-size="2.2mm"> <fo:block wrap-option="wrap" language="zh"><xsl:value-of select="qty"/></fo:block> </fo:table-cell> <fo:table-cell xsl:use-attribute-sets="border-cell-style"> <fo:block><xsl:value-of select="holdQty"/></fo:block> </fo:table-cell> </fo:table-row> </xsl:template>
最新发布
08-02
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值