FPDF多单元设置垂直

I'm using FPDF and I want to generate tables using MultiCell() since I need the word wrap property of it. Tried Cell() but it can't read the word wrap. If I used MultiCell() property then table all rows shows vertically.

PDF

If I used multicell() so my pdf data shows vertically. Please suggest me how to do vertical to horizontal.

I tried code:

    require('../fpdf.php');

class PDF extends FPDF
{
// Load data
function LoadData($file)
{
    // Read file lines
    $lines = file($file);
    $data = array();
    foreach($lines as $line)
        $data[] = explode(';',trim($line));
    return $data;
}

// Simple table
function BasicTable($header, $data, $pdf)
{
    // Header
    foreach($header as $col)
        $this->Cell(40, 20, $col, 1, 0, 'C', false);
    $this->Ln();
    // Data
    foreach($data as $row)
    {
        foreach($row as $col)
            //$word = str_word_count($col);
            //$this->MultiCell(30, 10,$col, 0, 'J', 0, 1, '', '', true, null, true);
            //$this->word_wrap($pdf,$col);
            //$this->cell(40,6,$col,1);
             $this->MultiCell(40,6,$col,1);
        $this->Ln();
    }
}

}

$pdf = new PDF('P','mm',array(600,600));
// Column headings
$header = array('Waybill', 'Order@No', 'Consignee Name', 'Consignee Pincode', 'Consignee City', 'Weight', 'COD Amount', 'Product', 'Shipping Client', 'Seller Name', 'Seller Pincode', 'Seller City');
// Data loading
$data = $pdf->LoadData('countries.txt');
$pdf->SetFont('Arial','',14);
$pdf->AddPage();
$pdf->BasicTable($header,$data, $pdf);
$pdf->Output();

Or please suggest me how to word wrap the text

You could use a class called PDF_MC_Table that is in the FPDF scripts page.

I've used this class for a very long list of PDF reports, and it works very well with text. Just remember that the data should be stored in a two-dimensional array with one row of the table for each $array[$x] position; so using a foreach loop you could print your table rows using the $pdf->Row() function.

Here is some example code.

$data[0]['name'] = 'Some string';
$data[0]['address'] = 'Address of the person';
$data[0]['telephone'] = 'the telephone number';

$data[1]['name'] = 'Other Person';
$data[1]['address'] = 'Address of the other person';
$data[1]['telephone'] = 'Another phone number';

$pdf->SetWidths(array(30,60,30));

$pdf->Row(array('Name','Address','Telephone')); //Set table header
foreach ($data as $value) {
    $pdf->Row(array($value['name'],$value['address'],$value['telephone']));
}