| 内容 | 大家在织梦建站修改模板的时候,肯定会遇到织梦自动生成 table,tr,td 等元素。
 而 table,tr,td 在织梦中远远不如<div> <li> 好用, 现在我来教大家如何 还我大div!
 在织梦../include/taglib 文件夹 找到arclist.lib.php 文件
 然后搜索如下字样
 if($col>1){ $artlist = “<table width=’$tablewidth’ border=’0′ cellspacing=’0′ cellpadding=’0′> ”; }
 修改为:
 if($col>1){ $artlist = “ ”; }
 查找:
 if($col>1) $artlist .= “<tr> ”;
 修改为:
 if($col>1) $artlist .= “ ”;
 查找:
 if($col>1) $artlist .= ” <td width=’$colWidth’ valign=’top’> ”;
 修改为:
 if($col>1) $artlist .= ” ”;
 查找:
 if($col>1) $artlist .= ” </td> ”;
 修改为:
 if($col>1) $artlist .= ” ”;
 查找:
 if($col>1){ $artlist .= ” </tr> ”;}
 修改为:
 if($col>1){ $artlist .= ” ”;}
 查找:
 if($col>1) $artlist .= ” </table> ”;
 修改为:
 if($col>1) $artlist .= ” ”;
 这样去掉所有table(表格)标签,然后在模板里使用channelArtlist标签,最终显示的内容将不再包含这些table元素了。
 在{dede:channelArtlist}与{/dede:channelArtlist}就能直接调用最终要显示的内容,不会含有多余的html代码了。
 |