Nur die erste Zeile eines Textes drucken
schubidu1000
- html
Hallo an alle ich habe ein Angebotsprogramm das die Angebote in mit HTML-konstruierten Formularen ausdruckt.
Ich möchte nun das Formular so verändern, das immer nur die Kurzform, nämlich nur die erste Zeile des Textes ausgedruckt wird.
Wie kann in HTML dies formatieren? Derzeit steht im KompoZer als Platzhalter pos-text und in der HTML-Ansicht:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Druck [ueberschrift]</title>
<link rel="stylesheet" href="format.css"
type="text/css">
</head>
<body>
<font style="font-family: Helvetica,Arial,sans-serif;"
face="Arial"><font size="2">[briefkopf]</font></font>
<div style="font-family: Helvetica,Arial,sans-serif;"
align="right">
<table border="1" bordercolor="#808080" cellpadding="5"
cellspacing="0">
<tbody>
<tr>
<th colspan="4" align="center" valign="top"><font
size="4">Angebot</font></th>
</tr>
<tr>
<td align="center" bgcolor="#f0f0f0"
nowrap="nowrap" valign="top"><small><font
size="2"><small>KD.-NR..</small></font></small></td>
<td align="center" bgcolor="#f0f0f0"
nowrap="nowrap" valign="top"><small><font
size="2"><small>VORGANGSNR.</small></font></small></td>
<td align="center" bgcolor="#f0f0f0"
nowrap="nowrap" valign="top"><small><font
size="2"><small>DATUM</small></font></small></td>
<td align="center" bgcolor="#f0f0f0"
nowrap="nowrap" valign="top"><small><font
size="2"><small>SEITE</small></font></small></td>
</tr>
<tr>
<td align="center" bgcolor="#f0f0f0"
nowrap="nowrap" valign="top"><font size="2">[kdnr]</font></td>
<td align="center" bgcolor="#f0f0f0"
nowrap="nowrap" valign="top"><font size="2">[vgnr]</font></td>
<td align="center" bgcolor="#f0f0f0"
nowrap="nowrap" valign="top"><font size="2">[datum]</font></td>
<td align="center" bgcolor="#f0f0f0"
nowrap="nowrap" valign="top"><font size="2">[seite]</font></td>
</tr>
<tr>
<td colspan="4" align="center" nowrap="nowrap"
valign="top"><font size="2">[hinweistext]</font></td>
</tr>
</tbody>
</table>
</div>
<p style="font-family: Helvetica,Arial,sans-serif;"><font
size="2">[projektbeschreibung]<br>
<br>
[vortext]</font></p>
<table style="font-family: Helvetica,Arial,sans-serif;"
border="1" bordercolor="#808080" cellpadding="2"
cellspacing="0" width="100%">
<tbody>
<tr>
<td align="center" nowrap="nowrap" valign="top"
width="9%"><small><font size="2"><small>POSITION</small></font></small></td>
<td nowrap="nowrap" valign="top"><small><font
size="2"><small>
LEISTUNGSBESCHREIBUNG</small></font></small></td>
<td align="center" nowrap="nowrap" valign="top"
width="20%"><small><font size="2"><small><br>
</small></font></small></td>
<td align="right" nowrap="nowrap" valign="top"
width="10%"><small><font size="2"><small>.</small></font></small></td>
<td align="right" nowrap="nowrap" valign="top"
width="10%"><small><font size="2"><small>GESAMT</small></font></small></td>
</tr>
</tbody>
</table>
<!-- [anfang] --> <br>
<font face="Arial" size="2">[steuerzeichen1]</font>
<table bgcolor="#f0f0f0" border="1" cellpadding="2"
width="100%">
<tbody>
<tr>
<td align="center" nowrap="nowrap" valign="top"
width="9%"><font face="Arial" size="2">[position]</font></td>
<td height="20" valign="top"><font
face="Arial" size="2">[pos_text]</font></td>
<td align="right" nowrap="nowrap" valign="top"
width="10%"></td>
<td align="left" valign="top" width="10%"><font
face="Arial" size="2"><br>
</font></td>
<td align="right" nowrap="nowrap" valign="top"
width="10%"><font color="#ffffff" face="Arial"
size="2">[einzelpreis]</font></td>
<td align="right" bgcolor="#ffffff"
nowrap="nowrap" valign="top" width="10%"><font
color="#ffffff" face="Arial" size="2">[gesamtpreis]</font></td>
</tr>
</tbody>
</table>
<font face="Arial" size="2">[steuerzeichen2]<!-- [ende] -->
</font><br>
<hr noshade="noshade" size="3">
<div align="right">
<table border="0" bordercolor="#ffffff" cellpadding="5"
cellspacing="0" width="400">
<tbody>
<tr>
<td bordercolor="#808080" bgcolor="#f0f0f0"
nowrap="nowrap" valign="top" width="50%"><font
face="Arial" size="2"><b>Gesamtsumme brutto</b></font></td>
<td bordercolor="#808080" align="right"
bgcolor="#f0f0f0" nowrap="nowrap" valign="top"
width="50%"><font face="Arial" size="2"><b>[netto] [w]</b></font></td>
</tr>
<tr>
<td bordercolor="#808080" bgcolor="#f0f0f0"
nowrap="nowrap" valign="top"><font face="Arial"
size="2"><b><br>
</b></font></td>
<td bordercolor="#808080" align="right"
bgcolor="#f0f0f0" nowrap="nowrap" valign="top"><font
face="Arial" size="2"><b><br>
</b></font></td>
</tr>
<tr>
<td colspan="2" bordercolor="#808080"
bgcolor="#f0f0f0" nowrap="nowrap" valign="top">
<hr noshade="noshade" size="1"> </td>
</tr>
<tr>
<td bordercolor="#808080" bgcolor="#f0f0f0"
nowrap="nowrap" valign="top"><font face="Arial"
size="2"><b>Endsumme</b></font></td>
<td bordercolor="#808080" align="right"
bgcolor="#f0f0f0" nowrap="nowrap" valign="top"><font
face="Arial" size="2"><b>[endsumme] [w]</b></font></td>
</tr>
<tr>
<td bordercolor="#808080" colspan="2"
bgcolor="#f0f0f0" nowrap="nowrap" valign="top">
<hr noshade="noshade" size="3"> </td>
</tr>
</tbody>
</table>
</div>
<hr noshade="noshade" size="1">
<font face="Arial" size="2">[lieferbedingung]<br>
<br>
[zahlungsbedingung]<br>
<br>
[werbetext]</font>
<p><font face="Arial" size="2">[nachtext]</font></p>
</body>
</html>
Om nah hoo pez nyeetz, schubidu1000!
Dein HTML ist stark verbesserungswürdig.
<link rel="stylesheet" href="format.css" type="text/css">
Schön, dass du ein zentrales Style-Dokument nutzen möchtest, dann brauchst du keinerlei style-Attribute.
<font style="font-family: Helvetica,Arial,sans-serif;"
face="Arial"><font size="2">[briefkopf]</font></font>
font-Elemente sind missbilligt, verwende CSS.
<div style="font-family: Helvetica,Arial,sans-serif;"
align="right">
Verwende CSS.
<table border="1" bordercolor="#808080" cellpadding="5"
cellspacing="0">
Verwende keine missbilligten Attribute, die Tabelle ist hier möglicherweise fehl am Platz.
<small><font
size="2"><small>KD.-NR..</small></font></small>
eine völlig überflüssige Schachtelung von small-Elementen
small-Elemente stehen für das "Kleingedruckte", verwende CSS für die Gestaltung
<br>
Abstände mit CSS
KUNDENNR.
Großschreibung mit CSS
<hr>
bezeichnet einen thematischen Bruch
Dein aufgeräumtes HTML sollte etwa so aussehen.
<!doctype html> <!-- HTML5 -->
<html>
<head>
<meta charset="utf-8"> <!-- unbedingt auch als utf8 ohne BOM speichern -->
<title>Druck [ueberschrift]</title>
<link rel="stylesheet" href="format.css" type="text/css">
</head>
<body>
<header>[briefkopf]</header>
<h1>Angebot</h1>
<table>
<thead>
<tr>
<th>Kundennr.</th>
<th>Vorgangsnr.</th>
<th>Datum</th>
<th>Seite</th>
</tr>
</thead>
<tbody>
<tr>
<td>[kdnr]</td>
<td>[vgnr]</td>
<td>[datum]</td>
<td>[seite]</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="4">[hinweistext]</td>
</tr>
</tfoot>
</table>
<h2>[projektbeschreibung]</h2>
<p>[vortext]</p>
<h3>Position</h3>
<p>[pos_text]</p>
<h3>Leistungsbeschreibung</h3>
<p>...</p>
</body>
</html>
Schau dich zunächst in unserem Wiki um.
Matthias