【发布时间】:2011-05-04 02:00:33
【问题描述】:
在 wordpress 插件中,我有一个 PHP 函数,可以将 $file_name(一个 CSV 文件)转换为一个表格。
function displayAsTable($file_name)
{
echo '<table>';
ini_set('auto_detect_line_endings',TRUE);
$f = fopen($file_name, "r");
while (($line = fgetcsv($f,0,",")) !== false) {
echo '<tr>';
echo '<td><input type="checkbox" name="addressXX" value="'.$line[2].'" name=""/></td>';
foreach ($line as $cell) {
echo '<td>' . htmlspecialchars($cell) . '</td>';
}
echo '<tr>';
}
fclose($f);
echo '</table>';
}
问题是我想将新的 ROWS 和 COLUMNS 添加到同一页面内的现有 TABLE 中!我怎么能轻易做到呢?
【问题讨论】:
标签: php html html-table