dongpang4470 2013-03-19 16:39
浏览 174
已采纳

基本的CSS样式(如border-bottom)不会影响动态创建的表

I'm reading a table data from MYSQL and writing it in html format to generate PDF (using TCPDF LIbrary) . but in resulting PDF only some of inline html CSS are affecting including(color,width.height) but other css like border-botttom(which I need the most) or all others ar being ignored by library.

$bookings_table_Result = mysql_query($bookings_table_query);
$tbl_header = '<table style=\"width:900px; border: 1px solid black; padding:0px;\">';
$tbl_footer = '</table>';
$tbl = '';

    while($row = mysql_fetch_array($bookings_table_Result)){
    $checkin = $row["checkin"];
    $checkout = $row["checkout"];
    $nights = $row["nights"];
    $guest = $row["guest"];
    $country = $row["country"];
    $guestcount = $row["guestcount"];
    $amount = $row["amount"];

    $tbl .= '<tr >

            <td style="border-bottom: solid 1px Black; width: 80px;">'.$checkin.'</td>
            <td style="border: 1px solid #000000; width: 80px;">'.$checkout.'</td>
            <td style="border: 1px solid #000000; width: 20px;">'.$nights.'</td>
            <td style="border: 1px solid #000000; width: 200px;">'.$guest.'</td>
            <td style="border: 1px solid #000000; width: 150px;">'.$country.'</td>
            <td style="border: 1px solid #000000; width: 40px;">'.$guestcount.'</td>
            <td style="border: 1px solid red; width: 80px; color: blue;">'.$amount.'</td>
            </tr>';
     };
$tbl .= '</table>';

$pdf->writeHTML($tbl, true, false, true, false, '');

I Uploaded the picture of Result PDF

enter image description here

  • 写回答

3条回答 默认 最新

  • doushi9856 2013-03-19 16:44
    关注

    You have a typo error in the line you use border-bottom , see:

    ... '<table style="width: 900px; border-bottom:1pt solid black;" border: 1px; cellspacing="0">';
                            This is out of the style attribute!! ------^
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥15 stable diffusion
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条