Bootstrap

超级好看的HTML表格,带自动整条选中的互动

超级好看的HTML表格,带自动整条选中的互动。


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">


<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>每日打卡</title>
<style>
  table {
    width: 100%;
    border-collapse: collapse;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  }
  th, td {
    text-align: left;
    padding: 8px;
    background-color: rgba(255, 255, 255, 0.5);
    border: 1px solid #ddd;
    color: #5c6770;
    font-size: 16px;
  }
  th {
    background-color: #5c6770;
    color: white;
    font-size: 18px;
  }
  tr:nth-child(even) {
    background-color: #f2f2f2;
  }
  tr:hover {
    background-color: #ddd;
  }
	td img {
    width: 90px;
  }
</style>

<style>
    .text-right {
        text-align: right;
		white-space: nowrap;
    }
</style>
</head>

<body>
<center>每日打卡,<div class="text-right"><?php echo $monday_date."-".$sunday_date;?></div></center>
<table>
  <tr>
    <th>打卡项目</th>
    <th>星期一</th>
    <th>星期二</th>
    <th>星期三</th>
    <th>星期四</th>
      <th>星期五</th>
      <th>星期六</th>
    <th>星期天</th>
  </tr>
  <tr>
    <td>锻炼</td>
    <td><img height='45px' src='./imgs/open.png'/></td>
    <td><img height='45px' src='./imgs/close.png'/></td>
    <td><img height='45px' src='./imgs/open.png'/></td>
    <td><img height='45px' src='./imgs/close.png'/></td>
    <td><img height='45px' src='./imgs/close.png'/></td>
    <td><img height='45px' src='./imgs/close.png'/></td>
    <td><img height='45px' src='./imgs/close.png'/></td>
  </tr>
  <tr>
    <td>看书</td>
    <td><img height='45px' src='./imgs/open.png'/></td>
    <td><img height='45px' src='./imgs/close.png'/></td>
    <td><img height='45px' src='./imgs/open.png'/></td>
    <td><img height='45px' src='./imgs/close.png'/></td>
    <td><img height='45px' src='./imgs/close.png'/></td>
    <td><img height='45px' src='./imgs/close.png'/></td>
    <td><img height='45px' src='./imgs/close.png'/></td>
  </tr>
  <!-- 更多行... -->
</table>
</body>
</html>

效果

在这里插入图片描述

;