cell.htm 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <HTML>
  3. <HEAD>
  4. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
  5. <TITLE>Cell</TITLE>
  6. <LINK TYPE="text/css" REL="stylesheet" HREF="../fpdf.css">
  7. </HEAD>
  8. <BODY>
  9. <H2>Cell</H2>
  10. <TT>Cell(<B>float</B> w [, <B>float</B> h [, <B>string</B> txt [, <B>mixed</B> border [, <B>int</B> ln [, <B>string</B> align [, <B>int</B> fill [, <B>mixed</B> link]]]]]]])</TT>
  11. <H4 CLASS='st'>Version</H4>
  12. 1.0
  13. <H4 CLASS='st'>Description</H4>
  14. Prints a cell (rectangular area) with optional borders, background color and character string.
  15. The upper-left corner of the cell corresponds to the current position. The text can be aligned
  16. or centered. After the call, the current position moves to the right or to the next line. It is
  17. possible to put a link on the text.
  18. <BR>
  19. If automatic page breaking is enabled and the cell goes beyond the limit, a page break is
  20. done before outputting.
  21. <H4 CLASS='st'>Parameters</H4>
  22. <TT><U>w</U></TT>
  23. <BLOCKQUOTE>
  24. Cell width. If <TT>0</TT>, the cell extends up to the right margin.
  25. </BLOCKQUOTE>
  26. <TT><U>h</U></TT>
  27. <BLOCKQUOTE>
  28. Cell height.
  29. Default value: <TT>0</TT>.
  30. </BLOCKQUOTE>
  31. <TT><U>txt</U></TT>
  32. <BLOCKQUOTE>
  33. String to print.
  34. Default value: empty string.
  35. </BLOCKQUOTE>
  36. <TT><U>border</U></TT>
  37. <BLOCKQUOTE>
  38. Indicates if borders must be drawn around the cell. The value can be either a number:
  39. <UL>
  40. <LI><TT>0</TT>: no border
  41. <LI><TT>1</TT>: frame
  42. </UL>
  43. or a string containing some or all of the following characters (in any order):
  44. <UL>
  45. <LI><TT>L</TT>: left
  46. <LI><TT>T</TT>: top
  47. <LI><TT>R</TT>: right
  48. <LI><TT>B</TT>: bottom
  49. </UL>
  50. Default value: <TT>0</TT>.
  51. </BLOCKQUOTE>
  52. <TT><U>ln</U></TT>
  53. <BLOCKQUOTE>
  54. Indicates where the current position should go after the call. Possible values are:
  55. <UL>
  56. <LI><TT>0</TT>: to the right
  57. <LI><TT>1</TT>: to the beginning of the next line
  58. <LI><TT>2</TT>: below
  59. </UL>
  60. Putting <TT>1</TT> is equivalent to putting <TT>0</TT> and calling Ln() just after.
  61. Default value: <TT>0</TT>.
  62. </BLOCKQUOTE>
  63. <TT><U>align</U></TT>
  64. <BLOCKQUOTE>
  65. Allows to center or align the text. Possible values are:
  66. <UL>
  67. <LI><TT>L</TT> or empty string: left align (default value)
  68. <LI><TT>C</TT>: center
  69. <LI><TT>R</TT>: right align
  70. </UL>
  71. </BLOCKQUOTE>
  72. <TT><U>fill</U></TT>
  73. <BLOCKQUOTE>
  74. Indicates if the cell background must be painted (<TT>1</TT>) or transparent (<TT>0</TT>).
  75. Default value: <TT>0</TT>.
  76. </BLOCKQUOTE>
  77. <TT><U>link</U></TT>
  78. <BLOCKQUOTE>
  79. URL or identifier returned by AddLink().
  80. </BLOCKQUOTE>
  81. <H4 CLASS='st'>Example</H4>
  82. <TABLE WIDTH="100%" BGCOLOR="#E0E0E0"><TR><TD>
  83. <TT>
  84. //Set font<BR>
  85. $pdf-&gt;SetFont('Arial','B',16);<BR>
  86. //Move to 8 cm to the right<BR>
  87. $pdf-&gt;Cell(80);<BR>
  88. //Centered text in a framed 20*10 mm cell and line break<BR>
  89. $pdf-&gt;Cell(20,10,'Title',1,1,'C');
  90. </TT>
  91. </TD></TR></TABLE><BR>
  92. <H4 CLASS='st'>See also</H4>
  93. <A HREF="setfont.htm">SetFont()</A>,
  94. <A HREF="setdrawcolor.htm">SetDrawColor()</A>,
  95. <A HREF="setfillcolor.htm">SetFillColor()</A>,
  96. <A HREF="settextcolor.htm">SetTextColor()</A>,
  97. <A HREF="setlinewidth.htm">SetLineWidth()</A>,
  98. <A HREF="addlink.htm">AddLink()</A>,
  99. <A HREF="ln.htm">Ln()</A>,
  100. <A HREF="multicell.htm">MultiCell()</A>,
  101. <A HREF="write.htm">Write()</A>,
  102. <A HREF="setautopagebreak.htm">SetAutoPageBreak()</A>.
  103. <HR STYLE="margin-top:1.2em">
  104. <DIV ALIGN="CENTER"><A HREF="index.htm">Index</A></DIV>
  105. </BODY>
  106. </HTML>