douyun1852 2016-04-25 17:10
浏览 29

在php中的dompdf中并排对齐表

I would like to have tables (both ordered by a different column) presented next to each other in dompdf. Css is not working in dompdf. I Tried with float:left but it doesn't work.

PHP and CSS Code is given as follows:

PHP CODE:

require_once ('dompdf_config.inc.php');

$pdf_content='
            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
            <html xmlns="http://www.w3.org/1999/xhtml">
            <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

            <style type="text/css"> 
            body{
            font-size:9px;
                }                       
        table {border-collapse: collapse; }
         th, td { padding: 5px; } 
        .floatedTable {
            float:left;
                      }

        .inlineTable {
            display: inline-block;
        }
            </style>
            </head>             
            <body>
            <div >';

                $pdf_content.='<table align="left" width="250px" border="1" cellspacing="0" cellpadding="1"> <tr > <td> <b>Govt Fund</b> </td><td>Rs</td><td>College Fund </td><td>Rs </td></tr><tr> <td>Admission Fee</td><td> </td><td>Sports Fund </td><td> </td></tr></table> <table  align="left" width="250px" border="1" cellspacing="0" cellpadding="1"> <tr > <td> <b>Govt Fund</b> </td><td>Rs</td><td>College Fund </td><td>Rs </td></tr><tr> <td>Admission Fee</td><td> </td><td>Sports Fund </td><td> </td></tr><tr> <td>Tution Fee</td><td> </td><td>General Fund </td><td> </td></tr><tr> <td>College Leaving Certificate Fee</td><td> </td><td>Library Fee </td><td> </td></tr></table>';

            $pdf_content.='</div></body></html>';
            $name = date("Ymd").rand().'.pdf';

    $pdf_userid=12; 
    $dompdf=new DOMPDF();
    $dompdf->load_html($pdf_content);
    $dompdf->render();
    $output = $dompdf->output();
    $dompdf->stream("Result.pdf", array("Attachment" => false));
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 wireshark抓不到vlan
    • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
    • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持
    • ¥15 stata安慰剂检验作图但是真实值不出现在图上
    • ¥15 c程序不知道为什么得不到结果
    • ¥40 复杂的限制性的商函数处理
    • ¥15 程序不包含适用于入口点的静态Main方法
    • ¥15 素材场景中光线烘焙后灯光失效
    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来