【问题标题】:HTML_Table package only fills the header rowHTML_Table 包只填充标题行
【发布时间】:2012-12-03 05:23:49
【问题描述】:

我很困惑。看起来很简单的 PEAR 包HTML_Table 只是填充了我的表格标题行的内容。使用 addRow 添加的所有行都是空的。这是代码 - 任何帮助表示赞赏!

require_once("HTML/Table.php");
$q = new HTML_Table();
$q->setAutoGrow(TRUE);
$th  = array("hdr1","hdr2","hdr3");
$tr1 = array("cell1","cell2","cell3");
$q->addRow($th, null, "th");
$q->addRow($tr1, null, "tr");
echo ($q->toHtml());

结果:

<table>
        <tr>
                <th>hdr1</th>
                <th>hdr2</th>
                <th>hdr3</th>
        </tr>
        <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
        </tr>
</table>

【问题讨论】:

  • 你能显示你用来显示这个输出的 php 吗?

标签: php pear html-table


【解决方案1】:

您在addRow() 中输入了错误的tr - 它应该是td

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-08-16
    • 1970-01-01
    • 1970-01-01
    • 2016-12-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多