1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > 相同内容多个html如何合并单元格 合并具有相同内容HTML的单元格

相同内容多个html如何合并单元格 合并具有相同内容HTML的单元格

时间:2023-08-30 07:03:35

相关推荐

相同内容多个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 column

echo $affichage[$i]->jour;

echo '

'; //1st line 2nd column

echo $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 '

';

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。