改变Joomla分类内容表格宽度、位置(change table width,height for joomla)
Joomla分类内容的表格的宽度和位置是固定写在程序中的,而且还比较难看,我们就来改一把
修改后的效果:效果演示
在 componentscom_contentcontent.html.php 的 240 行左右
- if ( $params->get( 'headings' ) ) {
- ?>
- <tr>
- <?php
- if ( $params->get( 'date' ) ) {
- ?>
- <td class="sectiontableheader<?php echo $params->get( 'pageclass_sfx' ); ?>" width="30%">
- </td>
- <?php
- }
- if ( $params->get( 'title' ) ) {
- ?>
- <td class="sectiontableheader<?php echo $params->get( 'pageclass_sfx' ); ?>">
- </td>
- <?php
- }
- if ( $params->get( 'author' ) ) {
- ?>
- <td class="sectiontableheader<?php echo $params->get( 'pageclass_sfx' ); ?>" align="left" width="20%">
- </td>
- <?php
- }
- if ( $params->get( 'hits' ) ) {
- ?>
- <td align="center" class="sectiontableheader<?php echo $params->get( 'pageclass_sfx' ); ?>" width="10%">
- </td>
- <?php
- }
- ?>
- </tr>
- <?php
- }
改变为:
- if ( $params->get( 'headings' ) ) {
- ?>
- <tr>
- <?php
- if ( $params->get( 'date' ) ) {
- ?>
- <td class="sectiontableheader<?php echo $params->get( 'pageclass_sfx' ); ?>" width="15%"align="center">
- </td>
- <?php
- }
- if ( $params->get( 'title' ) ) {
- ?>
- <td class="sectiontableheader<?php echo $params->get( 'pageclass_sfx' ); ?>" align="left">
- </td>
- <?php
- }
- if ( $params->get( 'author' ) ) {
- ?>
- <td class="sectiontableheader<?php echo $params->get( 'pageclass_sfx' ); ?>" align="center" width="15%">
- </td>
- <?php
- }
- if ( $params->get( 'hits' ) ) {
- ?>
- <td align="center" class="sectiontableheader<?php echo $params->get( 'pageclass_sfx' ); ?>" width="5%">
- </td>
- <?php
- }
- ?>
- </tr>
- <?php
- }
这时标题已经和内容的百分比已经设置好了,就是修改了其中的width和align属性值,如果想设置内容的对齐方式的话,再往下看
- $k = 0;
- foreach ( $items as $row ) {
- $row->created = mosFormatDate ($row->created, $params->get( 'date_format' ));
- // calculate Itemid
- HTML_content::_Itemid( $row );
- ?>
- <tr class="sectiontableentry<?php echo ($k+1) . $params->get( 'pageclass_sfx' ); ?>" >
- <?php
- if ( $params->get( 'date' ) ) {
- ?>
- <td>
- </td>
- <?php
- }
- if ( $params->get( 'title' ) ) {
- if( $row->access <= $gid ){
- $link = sefRelToAbs( 'index.php?option=com_content&task=view&id='. $row->id .'&Itemid='. $Itemid );
- ?>
- <td>
- <a href="<?php echo $link; ?>">
- </a>
- <?php
- HTML_content::EditIcon( $row, $params, $access );
- ?>
- </td>
- <?php
- } else {
- ?>
- <td>
- <?php
- $link = sefRelToAbs( 'index.php?option=com_registration&task=register' );
- ?>
- <a href="<?php echo $link; ?>">
- </a>
- </td>
- <?php
- }
- }
- if ( $params->get( 'author' ) ) {
- ?>
- <td align="left">
- </td>
- <?php
- }
- if ( $params->get( 'hits' ) ) {
- ?>
- <td align="center">
- </td>
- <?php
- } ?>
- </tr>
- <?php
- $k = 1 - $k;
- }
把响应的 align="left" 修改为center,right就可以了





