Centrer les "forums"

4 participants

Voir le sujet précédent Voir le sujet suivant Aller en bas

Résolu Centrer les "forums"

Message par Gamersplace Dim 10 Fév 2013, 21:06

Bonjour, je suis sur phpbb2.
J'aimerais centrer le titre de mes catégorie, j'ai ajouté <center></center> dans le titre, mais cela me le décale juste un peu sur la droite.

Spoiler:

Mon template :

Code:
<table width="100%" border="0" cellspacing="1" cellpadding="0" align="center">
   <tr>
      <td valign="bottom">
         <!-- BEGIN switch_user_logged_in -->
         <span class="gensmall">{LAST_VISIT_DATE}<br />
         {CURRENT_TIME}<br />
         </span>
         <!-- END switch_user_logged_in -->
         <div class="nav"><a class="nav" href="{U_INDEX}">{L_INDEX}</a>{NAV_CAT_DESC}</div>
      </td>
      <td class="gensmall" align="right" valign="bottom">
         <!-- BEGIN switch_user_logged_in -->
         <a class="gensmall" href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a><br />
         <a class="gensmall" href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a><br />
         <!-- END switch_user_logged_in -->
         <a class="gensmall" href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a>
      </td>
   </tr>
</table>
<!-- BEGIN catrow --><!-- BEGIN tablehead --><table class="forumline" width="100%" border="0" cellspacing="1" cellpadding="0">
   <tr>
      <th colspan="{catrow.tablehead.INC_SPAN}" nowrap="nowrap" width="100%" class="secondarytitle"> {catrow.tablehead.L_FORUM} </th>
      
      <th nowrap="nowrap" width="150"><div style="width:150px;">{L_LASTPOST}</div></th>
   </tr>
   <!-- END tablehead -->
   <!-- BEGIN cathead -->
   <tr>
      <!-- BEGIN inc -->
      <td class="{catrow.cathead.inc.INC_CLASS}" width="46"><img src="{SPACER}" height="0" width="46" /></td>
      <!-- END inc -->
      <td class="{catrow.cathead.CLASS_CAT}" colspan="{catrow.cathead.INC_SPAN}" width="100%">
         <h{catrow.cathead.LEVEL} class="hierarchy">
            <span class="cattitle">
               <a class="cattitle" title="{catrow.cathead.CAT_DESC}" href="{catrow.cathead.U_VIEWCAT}">{catrow.cathead.CAT_TITLE}</a>
            </span>
         </h{catrow.cathead.LEVEL}>
      </td>
      <td class="{catrow.cathead.CLASS_ROWPIC}" colspan="3" align="right"> </td>
   </tr>
   <!-- END cathead -->
   <!-- BEGIN forumrow -->
   <tr>
      <!-- BEGIN inc -->
      <td class="{catrow.forumrow.inc.INC_CLASS}" width="46"><img src="{SPACER}" height="0" width="46" alt="." /></td>
      <!-- END inc -->
      
      <td class="row1 over" colspan="{catrow.forumrow.INC_SPAN}" valign="top" width="100%" height="50">
         <table width="100%"><tbody><tr><td><h{catrow.forumrow.LEVEL} class="hierarchy">
            <span class="forumlink">
              <a class="forumlink" href="{catrow.forumrow.U_VIEWFORUM}">{catrow.forumrow.FORUM_NAME}</a>
 
            </span>
        </h{catrow.forumrow.LEVEL}></td><td style="padding-left: 40px; text-align: right;" class="gensmall">{catrow.forumrow.POSTS} messages dans {catrow.forumrow.TOPICS} sujets.</td></tr></tbody></table>
         <span class="genmed">{catrow.forumrow.FORUM_DESC}</span>
         <span class="gensmall">
            <!-- BEGIN switch_moderators_links -->
            {catrow.forumrow.switch_moderators_links.L_MODERATOR}{catrow.forumrow.switch_moderators_links.MODERATORS}
            <!-- END switch_moderators_links -->
            {catrow.forumrow.L_LINKS}{catrow.forumrow.LINKS}
         </span>
      </td>
   
          <td class="{catrow.forumrow.INC_CLASS}" align="center" valign="middle">
         <img title="{catrow.forumrow.L_FORUM_FOLDER_ALT}" src="{catrow.forumrow.FORUM_FOLDER_IMG}" alt="{catrow.forumrow.L_FORUM_FOLDER_ALT}" />
      </td>
         
      <td class="row3 over" align="center" valign="middle" height="50">
         <span class="gensmall">{catrow.forumrow.LAST_POST}</span>
      </td>
   </tr>
   <!-- END forumrow -->
   <!-- BEGIN catfoot -->
   <tr>
      <!-- BEGIN inc -->
      <td class="{catrow.catfoot.inc.INC_CLASS}" width="46"><img src="{SPACER}" height="0" width="46" /></td>
      <!-- END inc -->
      <td class="spaceRow" colspan="{catrow.catfoot.INC_SPAN}" height="1"><img src="{SPACER}" alt="" height="1" width="1" /></td>
   </tr>
   <!-- END catfoot -->
   <!-- BEGIN tablefoot -->
</table><img src="{SPACER}" alt="" height="5" width="1" /><!-- END tablefoot --><!-- END catrow -->

Lien du forum

Merci d'avance !!
avatar

Gamersplace
Nouveau membre

Messages : 12
Inscrit(e) le : 11/01/2013

http://gamersplace.forum2jeux.com/
Gamersplace a été remercié(e) par l'auteur de ce sujet.

Résolu Re: Centrer les "forums"

Message par Scipion Dim 10 Fév 2013, 23:51

Bonsoir

Je vous propose de faire un essai comme suit :

- Repérez le code suivant :

Code:
<th colspan="{catrow.tablehead.INC_SPAN}" nowrap="nowrap" width="100%" class="secondarytitle"> {catrow.tablehead.L_FORUM} </th>
- Ajoutez la balise center :

Code:
<th colspan="{catrow.tablehead.INC_SPAN}" nowrap="nowrap" width="100%" class="secondarytitle"><center>{catrow.tablehead.L_FORUM}</center></th>
- Au final, vous obtiendrez le template index_box suivant que je vous demande de tester tel quel :

Code:
<table width="100%" border="0" cellspacing="1" cellpadding="0" align="center">
  <tr>
      <td valign="bottom">
        <!-- BEGIN switch_user_logged_in -->
        <span class="gensmall">{LAST_VISIT_DATE}<br />
        {CURRENT_TIME}<br />
        </span>
        <!-- END switch_user_logged_in -->
        <div class="nav"><a class="nav" href="{U_INDEX}">{L_INDEX}</a>{NAV_CAT_DESC}</div>
      </td>
      <td class="gensmall" align="right" valign="bottom">
        <!-- BEGIN switch_user_logged_in -->
        <a class="gensmall" href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a><br />
        <a class="gensmall" href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a><br />
        <!-- END switch_user_logged_in -->
        <a class="gensmall" href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a>
      </td>
  </tr>
</table>
<!-- BEGIN catrow --><!-- BEGIN tablehead --><table class="forumline" width="100%" border="0" cellspacing="1" cellpadding="0">
  <tr>
      <th colspan="{catrow.tablehead.INC_SPAN}" nowrap="nowrap" width="100%" class="secondarytitle"><center> {catrow.tablehead.L_FORUM} </center></th>
     
      <th nowrap="nowrap" width="150"><div style="width:150px;">{L_LASTPOST}</div></th>
  </tr>
  <!-- END tablehead -->
  <!-- BEGIN cathead -->
  <tr>
      <!-- BEGIN inc -->
      <td class="{catrow.cathead.inc.INC_CLASS}" width="46"><img src="{SPACER}" height="0" width="46" /></td>
      <!-- END inc -->
      <td class="{catrow.cathead.CLASS_CAT}" colspan="{catrow.cathead.INC_SPAN}" width="100%">
        <h{catrow.cathead.LEVEL} class="hierarchy">
            <span class="cattitle">
              <a class="cattitle" title="{catrow.cathead.CAT_DESC}" href="{catrow.cathead.U_VIEWCAT}">{catrow.cathead.CAT_TITLE}</a>
            </span>
        </h{catrow.cathead.LEVEL}>
      </td>
      <td class="{catrow.cathead.CLASS_ROWPIC}" colspan="3" align="right"> </td>
  </tr>
  <!-- END cathead -->
  <!-- BEGIN forumrow -->
  <tr>
      <!-- BEGIN inc -->
      <td class="{catrow.forumrow.inc.INC_CLASS}" width="46"><img src="{SPACER}" height="0" width="46" alt="." /></td>
      <!-- END inc -->
     
      <td class="row1 over" colspan="{catrow.forumrow.INC_SPAN}" valign="top" width="100%" height="50">
        <table width="100%"><tbody><tr><td><h{catrow.forumrow.LEVEL} class="hierarchy">
            <span class="forumlink">
              <a class="forumlink" href="{catrow.forumrow.U_VIEWFORUM}">{catrow.forumrow.FORUM_NAME}</a>
 
            </span>
        </h{catrow.forumrow.LEVEL}></td><td style="padding-left: 40px; text-align: right;" class="gensmall">{catrow.forumrow.POSTS} messages dans {catrow.forumrow.TOPICS} sujets.</td></tr></tbody></table>
        <span class="genmed">{catrow.forumrow.FORUM_DESC}</span>
        <span class="gensmall">
            <!-- BEGIN switch_moderators_links -->
            {catrow.forumrow.switch_moderators_links.L_MODERATOR}{catrow.forumrow.switch_moderators_links.MODERATORS}
            <!-- END switch_moderators_links -->
            {catrow.forumrow.L_LINKS}{catrow.forumrow.LINKS}
        </span>
      </td>
 
          <td class="{catrow.forumrow.INC_CLASS}" align="center" valign="middle">
        <img title="{catrow.forumrow.L_FORUM_FOLDER_ALT}" src="{catrow.forumrow.FORUM_FOLDER_IMG}" alt="{catrow.forumrow.L_FORUM_FOLDER_ALT}" />
      </td>
       
      <td class="row3 over" align="center" valign="middle" height="50">
        <span class="gensmall">{catrow.forumrow.LAST_POST}</span>
      </td>
  </tr>
  <!-- END forumrow -->
  <!-- BEGIN catfoot -->
  <tr>
      <!-- BEGIN inc -->
      <td class="{catrow.catfoot.inc.INC_CLASS}" width="46"><img src="{SPACER}" height="0" width="46" /></td>
      <!-- END inc -->
      <td class="spaceRow" colspan="{catrow.catfoot.INC_SPAN}" height="1"><img src="{SPACER}" alt="" height="1" width="1" /></td>
  </tr>
  <!-- END catfoot -->
  <!-- BEGIN tablefoot -->
</table><img src="{SPACER}" alt="" height="5" width="1" /><!-- END tablefoot --><!-- END catrow -->
Cordialement
Scipion

Scipion
Membre actif

Masculin
Messages : 8655
Inscrit(e) le : 03/02/2010

https://forum.forumactif.com/
Scipion a été remercié(e) par l'auteur de ce sujet.

Résolu Re: Centrer les "forums"

Message par Gamersplace Lun 11 Fév 2013, 13:11

Merci de votre coup de main ! Mais cela ne fonctionne pas Embarassed
avatar

Gamersplace
Nouveau membre

Messages : 12
Inscrit(e) le : 11/01/2013

http://gamersplace.forum2jeux.com/
Gamersplace a été remercié(e) par l'auteur de ce sujet.

Résolu Re: Centrer les "forums"

Message par Manumanu Lun 11 Fév 2013, 13:36

Bonjour,

Tout d'abord, la balise <center> est dépréciée et ne devrait plus être utilisée. Le CSS est là pour tout ce qui touche à la mise en page.

Ensuite, le code va dépendre de l'agencement de ton forum (Panneau d'admin → Affichage → Page d'accueil → Structure et hiérarchie) : Tu vois que tu peux conserver ou séparer les catégories sur l'index. Quel est ton cas ? Je t'indiquerais les modifications à faire en fonction. Wink
Manumanu

Manumanu
****

Masculin
Messages : 437
Inscrit(e) le : 27/12/2011

http://helpinghelps-phpbb2.forumgratuit.org/
Manumanu a été remercié(e) par l'auteur de ce sujet.

Résolu Re: Centrer les "forums"

Message par Gamersplace Lun 11 Fév 2013, 14:12

Salut,

Je n'y connais malheureusement pas grand chose en CSS, la plupart de mon css c'est du copier coller Wink

Centrer les "forums" 1360588240-capture-d-ecran-2013-02-11-a-14-10-22

Merci d'avance !
avatar

Gamersplace
Nouveau membre

Messages : 12
Inscrit(e) le : 11/01/2013

http://gamersplace.forum2jeux.com/
Gamersplace a été remercié(e) par l'auteur de ce sujet.

Résolu Re: Centrer les "forums"

Message par Scipion Lun 11 Fév 2013, 14:21

Bonjour

Essayez cette méthode :

Like a Star @ heaven Nom de la catégorie : installez ce code

Code:
<div align="center">Titre de la catégorie</div>
Like a Star @ heaven Enregistrez

Cordialement
Scipion

Scipion
Membre actif

Masculin
Messages : 8655
Inscrit(e) le : 03/02/2010

https://forum.forumactif.com/
Scipion a été remercié(e) par l'auteur de ce sujet.

Résolu Re: Centrer les "forums"

Message par Gamersplace Lun 11 Fév 2013, 14:50

Non ca ne fonctionne toujours pas :S
Ca continue de décaler sur la droite comme sur le premier screen.
avatar

Gamersplace
Nouveau membre

Messages : 12
Inscrit(e) le : 11/01/2013

http://gamersplace.forum2jeux.com/
Gamersplace a été remercié(e) par l'auteur de ce sujet.

Résolu Re: Centrer les "forums"

Message par Scipion Lun 11 Fév 2013, 15:04

Pourtant sur mon forum phpBB2 le code fonctionne à merveille pour centrer ou déplacer le titre de la catégorie à gauche ou à droite.

Auriez-vous une feuille de style CSS personnalisée ? Dans l'affirmative, mettez ici svp tout son contenu afin que je puisse faire des tets.

Cordialement
Scipion

Scipion
Membre actif

Masculin
Messages : 8655
Inscrit(e) le : 03/02/2010

https://forum.forumactif.com/
Scipion a été remercié(e) par l'auteur de ce sujet.

Résolu Re: Centrer les "forums"

Message par Gamersplace Lun 11 Fév 2013, 18:43

Et voici Wink :

Code:
.titre2 { text-transform: lowercase;
  letter-spacing: -3px;
  font-family: times new roman;
  font-style: italic;
  text-align: center;
  font-size: 50px;
  color: #FABF7D;
 }

.arthur {
  height: 140px;
  border: 3px solid #FABF7D; /* couleur des bords */
 
    display: block;
    padding-left: 10px;
    padding-right: 10px;
    text-align:justify;
  line-height: 12px;
  background-color: #F5DFB1; /* couleur du fond */
}

a.forumlink {
text-shadow: #F5DFB1 1px 1px 1px;
}

a { text-decoration: none; }



.forumline{ 
    background-color: #F5AF5F;
        -moz-border-radius:6px;     
        border-bottom: 6px #F5AF5F solid;
    }

a {
        transition:all 0.5s;
        -moz-transition:all 0.5s; /* Mozilla Firefox */
        -webkit-transition:all 0.5s; /* Safari et Google Chrome */
        -o-transition:all 0.5s; /* Opera */
    }

body {
cursor : crosshair ;
}

.postbody a {
  display: inline-block;
  max-width: 300px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.catHead{
-moz-border-radius-topleft: 20px;
      -moz-border-radius-topright: 20px;
      -webkit-border-top-right-radius: 20px;
      -webkit-border-top-left-radius: 20px;
      border-top-right-radius: 10px;
      border-top-left-radius: 10px;
   
}

.bulle_profil {
background-color:#F5DFB1; /* couleur du fond de la bulle */
-webkit-border-radius:15px;
-moz-border-radius:15px;
border-radius:15px;}
avatar

Gamersplace
Nouveau membre

Messages : 12
Inscrit(e) le : 11/01/2013

http://gamersplace.forum2jeux.com/
Gamersplace a été remercié(e) par l'auteur de ce sujet.

Résolu Re: Centrer les "forums"

Message par Scipion Lun 11 Fév 2013, 19:08

Ajoutez dans votre feuille de style CSS le code suivant :

Code:
.secondarytitle {
text-align:center;
}
Dans les noms des catégories, laissez uniquement les titres et rien de plus.

Cordialement
Scipion

Scipion
Membre actif

Masculin
Messages : 8655
Inscrit(e) le : 03/02/2010

https://forum.forumactif.com/
Scipion a été remercié(e) par l'auteur de ce sujet.

Résolu Re: Centrer les "forums"

Message par Manumanu Lun 11 Fév 2013, 19:15

Donne l'adresse de ton forum au besoin, que je puisse regarder directement. Wink
Manumanu

Manumanu
****

Masculin
Messages : 437
Inscrit(e) le : 27/12/2011

http://helpinghelps-phpbb2.forumgratuit.org/
Manumanu a été remercié(e) par l'auteur de ce sujet.

Résolu Re: Centrer les "forums"

Message par Anzu Lun 11 Fév 2013, 19:16

Scipion > vous confondez avec les catégories.
---

Gamersplace > Bonsoir,

De base, votre template est juste, les balises center sont correctement placées et en fait le titre est bien centré, du moins en théorie.
Il faut simplement rajouter un width dans le td concerné:

Code:
<td align="center" width="400px"><h{catrow.forumrow.LEVEL} class="hierarchy">
                    <center><span class="forumlink">
                      <a class="forumlink" href="{catrow.forumrow.U_VIEWFORUM}">{catrow.forumrow.FORUM_NAME}</a>
       
                      </span></center>
                </h{catrow.forumrow.LEVEL}></td>

Vous pouvez encore augmenter la valeur du width mais le titre va finir par écraser la mention "X sujets / x Messages", donc le mieux serait de déplacer cette partie ailleurs dans le template.

Cordialement.
Anzu

Anzu
Membre actif

Féminin
Messages : 20685
Inscrit(e) le : 30/08/2007

https://forum.forumactif.com/
Anzu a été remercié(e) par l'auteur de ce sujet.

Résolu Re: Centrer les "forums"

Message par Anzu Jeu 14 Fév 2013, 17:14

Gamersplace > Bonsoir,

Cette demande est-elle résolue ?

Cordialement.
Anzu

Anzu
Membre actif

Féminin
Messages : 20685
Inscrit(e) le : 30/08/2007

https://forum.forumactif.com/
Anzu a été remercié(e) par l'auteur de ce sujet.

Voir le sujet précédent Voir le sujet suivant Revenir en haut

- Sujets similaires

Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum