本中心为您提供所有足球赛事的最新即时比分,包括:中超、英超、西甲、德甲、意甲、法甲、欧冠、欧联杯等。
正在进行的比赛:
今日比赛:
明日比赛:
<script>
// 假数据,实际需要用status: "上半场结束"},{match: "英超:利物浦 vs 曼联",time: "2023-03-09 23:00",score: "0:0",status: "进行中"},{match: "西甲:巴塞罗那 vs 皇家马德里",time: "2023-03-12 03:00",score: null,status: "未开始"},];const todayData = [{match: "中超:河北队 vs 成都蓉城",time: "2023-03-08 15:30"},{match: "英超:托特纳姆热刺 vs 布莱顿",time: "2023-03-09 18:30"},{match: "德甲:拜仁慕尼黑 vs 多特蒙德",time: "2023-03-10 22:30"},];const tomorrowData = [{match: "意甲:尤文图斯 vs 国际米兰",time: "2023-03-11 03:00"},{match: "法甲:巴黎圣日耳曼 vs 里昂",time: "2023-03-12 01:00"},];function renderTable(tableId, data) {const table = document.getElementById(tableId);const tbody = table.getElementsByTagName('tbody')[0];// 清空表格内容tbody.innerHTML = '';// 遍历数据并添加行for (let i= 0; i < data.length; i++) {const row = tbody.insertRow(i);const matchCell = row.insertCell(0);matchCell.innerText = data[i].match;const timeCell = row.insertCell(1);timeCell.innerText = data[i].time;// 比分和状态列只有正在进行的比赛才有if (data[i].score !== null && data[i].status !== null) {const scoreCell = row.insertCell(2);scoreCell.innerText = data[i].score;const statusCell = row.insertCell(3);statusCell.innerText = data[i].status;// 根据比分高亮胜负方if (data[i].score.split(':')[0] > data[i].score.split(':')[1]) {matchCell.classList.add('highlight');} else if (data[i].score.split(':')[0] < data[i].score.split(':')[1]) {timeCell.classList.add('highlight');}}}}renderTable('live-table', liveData);renderTable('today-table', todayData);renderTable('tomorrow-table', tomorrowData);
</script>
相关阅读: 足球即时比分中心 全面报道所有赛事