Jac*_*ors 9 css pdf coldfusion html-table cfml
我正在使用cfdocument在ColdFusion中创建PDF.我需要制作一个倾斜的标题行的表格,以便它全部适合页面.这是我想要完成的一个例子.
到目前为止,我找到的HTML或CSS示例都没有奏效.现在我想知道这是否是特定于ColdFusion和/或PDF创建的怪癖.我知道这段代码直接来自这里类似问题的答案,但它并没有在我的PDF中创建一个带有斜柱的表.它创造了这个.
//CSS
* {
box-sixing: border-box;
}
.outerDiv {
background: grey;
height: 200px;
width: 100px;
border: 1px solid black;
border-bottom: 0;
border-left: 0;
transform: skew(-30deg) translateX(58%);
}
th:first-child .outerDiv {
border-left: 1px solid black;
position: relative;
}
.innerDiv {
position: absolute;
width: 250px;
height: 85px;
bottom: -34%;
left: 10px;
transform: skew(30deg) rotate(-60deg);
transform-origin: 0 0;
text-align: left;
}
body,
html {
height: 100%;
}
body {
display: flex;
justify-content: center;
}
table {
border-collapse: collapse;
}
td {
border: 1px solid black;
}
.well {
min-height: 20px;
padding: 5px;
margin-bottom: 10px;
background-color: #f5f5f5;
border: 1px solid black;
border-radius: 3px;
}
.well_tight {
padding: 3px;
margin-bottom: 5px;
background-color: #f5f5f5;
border: 1px solid black;
border-radius: 3px;
}
//ColdFusion/HTML
<cfdocument format="pdf" name="#formname#" pagetype="letter" marginleft=".25" marginright=".25" margintop=".25" marginbottom=".5">
<cfoutput><style type="text/css">@import "/mach15/web/assets/css/formPDF.css";</style></cfoutput>
<div class="well">
<table cellpadding="0" cellspacing="0">
<tr>
<th>
<div class="outerDiv">
<div class="innerDiv">This is first column header</div>
</div>
</th>
<th>
<div class="outerDiv">
<div class="innerDiv">This is second column header</div>
</div>
</th>
<th>
<div class="outerDiv">
<div class="innerDiv">This is third column header</div>
</div>
</th>
</tr>
<tr>
<td> 1 </td>
<td> 2 </td>
<td> 3 </td>
</tr>
<tr>
<td> 4 </td>
<td> 5 </td>
<td> 6 </td>
</tr>
<tr>
<td> 7 </td>
<td> 8 </td>
<td> 9 </td>
</tr>
<tr>
<td> 10 </td>
<td> 11 </td>
<td> 12 </td>
</tr>
</table>
</div>
Run Code Online (Sandbox Code Playgroud)
您使用的是CF11或以上版本吗?如果是这样,请使用<cfhtmltopdf>更好的 css 支持而不是旧的<cfdocument>.
https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-tags/tags-gh/cfhtmltopdf.html
| 归档时间: |
|
| 查看次数: |
607 次 |
| 最近记录: |