我有一张看起来像这样的表:
<?php
class Custom_FPDF extends FPDF
{
protected $FontSpacingPt; // current font spacing in points
protected $FontSpacing; // current font spacing in user units
function SetFontSpacing($size)
{
if($this->FontSpacingPt==$size)
return;
$this->FontSpacingPt = $size;
$this->FontSpacing = $size/$this->k;
if ($this->page>0)
$this->_out(sprintf('BT %.3f Tc ET', $size));
}
protected function _dounderline($x, $y, $txt)
{
// Underline text
$up = $this->CurrentFont['up'];
$ut = $this->CurrentFont['ut'];
$w = $this->GetStringWidth($txt)+$this->ws*substr_count($txt,' ')+(strlen($txt)-1)*$this->FontSpacing;
return sprintf('%.2F %.2F %.2F %.2F re f',$x*$this->k,($this->h-($y-$up/1000*$this->FontSize))*$this->k,$w*$this->k,-$ut/1000*$this->FontSizePt);
}
}
我还有一个删除按钮作为每行的一个。我究竟如何获得该行中显示的fullName?
我试过像
这样的东西$pdf = new Custom_FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial', 'BU', 11);
$pdf->SetFontSpacing(3);
$pdf->Cell(0, 10, 'Test of letter spacing with underline', 0, 1);
$pdf->SetFontSpacing(0);
$pdf->Cell(0, 10, 'Test of letter spacing with underline');
$pdf->Output();
但是,每一行的fullName都被选中。 (例如,name1name2name3 ...)
答案 0 :(得分:0)
我相信这是重复的。已经询问并回答了同样的问题here。
但是,您正在寻找的答案可能是:
$(this).closest('tr').children('td#fullNameID').text();
这假设您的表格单元格与删除按钮位于同一行内。