相同内容多个html如何合并单元格,合并具有相同内容HTML的单元格
搞定了
使用PHP類來完成它。抱歉,法語變量名稱
class jours {
var $jour;
var $horaire;
var $nbr=0;
}
$lundi = new jours();
$mardi = new jours();
$mercredi = new jours();
$jeudi = new jours();
$vendredi = new jours();
$lundi->jour = "Lundi";
$mardi->jour = "Mardi";
$mercredi->jour = "Mercredi";
$jeudi->jour = "Jeudi";
$vendredi->jour = "Vendredi";
// rest of the code, queries
switch ($infos['jour']){
case 'Lundi':
$lundi->horaire[$lundi->nbr] = $infos['horaire'];
$lundi->nbr++;
break;
case 'Mardi':
$mardi->horaire[$mardi->nbr] = $infos['horaire'];
$mardi->nbr++;
break;
case 'Mercredi':
$mercredi->horaire[$mercredi->nbr] = $infos['horaire'];
$mercredi->nbr++;
break;
case 'Jeudi':
$jeudi->horaire[$jeudi->nbr] = $infos['horaire'];
$jeudi->nbr++;
break;
case 'Vendredi':
$vendredi->horaire[$vendredi->nbr] = $infos['horaire'];
$vendredi->nbr++;
break;
}
// display the table
$affichage = array($lundi,$mardi,$mercredi,$jeudi,$vendredi); //used this array to be able to make the for loop later
echo '
for($i=0;$i<5;$i++){
if($affichage[$i]->nbr != 0){
echo '
'; //1st line 1st columnecho $affichage[$i]->jour;
echo '
'; //1st line 2nd columnecho $affichage[$i]->horaire['0'];
echo '
';for($j=1; $j < $affichage[$i]->nbr; $j++){ //other lines and columns
echo '
';echo $affichage[$i]->horaire[$j];
echo '
';}
}
}
echo '
';總結
以上是生活随笔為你收集整理的相同内容多个html如何合并单元格,合并具有相同内容HTML的单元格的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: pyqt5上位机开发框架
- 下一篇: windows10下录屏