TCPDF: Extrem minimalistisches CSS
bearbeitet von LinuchsMoin,
per PHP erzeuge ich eine PDF-Datei. Als Hintergrundbild ein formular.jpg. Nun möchte ich Werte in die Formularfelder schreiben.
Da geht es schon los, `position:absolute` wird nicht verstanden. [Stand Jan. '15](https://stackoverflow.com/questions/28105411/tcpdf-how-can-i-show-a-div-with-absolute-position-in-a-pdf-created-with-tcpdf):
Currently, only the following CSS attributes are supported:
+ font-family
+ font-size
+ font-weight
+ font-style
+ color
+ background-color
+ text-decoration
+ width
Aber nichtmal das funktioniert. Der graue `p` ist keine 58mm hoch (mit `div` hat's auch nicht geklappt) und width sowie background-color der `td` wird ignoriert:
[![PDF](/images/37c30916-a405-11ea-8e8b-b42e9947ef30.jpg?size=medium)](/images/37c30916-a405-11ea-8e8b-b42e9947ef30.jpg)
~~~html
<style>
table#gema {
width: 100%;
color: #00f;
border: .1pt solid #f00;
}
td.sp01 { width: 32mm; background-color: #eee; }
td.sp02 { width: 83mm; background-color: #fff; }
td.sp03 { width: 12mm; background-color: #eee; }
td.sp04 { width: 12mm; background-color: #fff; }
td.sp05 { width: 12mm; background-color: #eee; }
td.sp06 { width: 12mm; background-color: #fff; }
</style>
<body>
<p style="height:58mm;border:.1pt solid #f00;background-color:#eee;"> <!-- margin-top --></p>
<table id="gema">
<tbody>
<tr>
<td class=sp01><!-- margin-left --></td>
<td class=sp02>Titel 1</td>
<td class=sp03>Komponist 1</td>
<td class=sp04>Bearbeiter 1</td>
<td class=sp05>Verlag 1</td>
<td class=sp06>1</td>
</tr>
</tbody>
</table>
</body>
~~~
Habt ihr einen Tipp, wie ich die Daten gezielt platzieren kann?
fragt Linuchs