求 css定义一个 6行5列的table,第一行为th红色边框,怎么说呢,类似于多个“田”字吧
发布网友
发布时间:2022-06-05 13:59
我来回答
共2个回答
热心网友
时间:2023-12-14 18:31
简单表格.html 文件代码清单如下:
<!doctype html>
<html lang="zh">
<head>
<meta charset="utf-8" />
<title>简单表格</title>
<link rel="stylesheet" href="table.css" />
</head>
<body>
<table>
<caption>
create your own bingo card
</caption>
<tr>
<th>b</th>
<th>i</th>
<th>n</th>
<th>g</th>
<th>o</th>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
</tr>
<tr>
<td>6</td>
<td>7</td>
<td>8</td>
<td>9</td>
<td>10</td>
</tr>
<tr>
<td>11</td>
<td>12</td>
<td>13</td>
<td>14</td>
<td>15</td>
</tr>
<tr>
<td>16</td>
<td>17</td>
<td>18</td>
<td>19</td>
<td>20</td>
</tr>
<tr>
<td>21</td>
<td>22</td>
<td>23</td>
<td>24</td>
<td>25</td>
</tr>
</table>
</body>
</html>
table.css 文件代码清单如下:
table {
border: none;
border-collapse: collapse;
}
table caption {
font-size: 1.2em;
font-weight: bold;
}
table th {
border: 1px solid red;
width: 100px;
height: 100px;
}
table td {
border: 1px solid #000;
width: 100px;
height: 100px;
}
热心网友
时间:2023-12-14 18:31
<style type="text/css">
table { text-align:center; border-left:1px solid #000; border-top:1px solid #000;}
table tr td{ border-right:1px solid #000; border-bottom:1px solid #000; height:60px;}
.red{border-left:1px solid #F00; border-top:1px solid #F00; border-right:1px solid #F00; border-bottom:1px solid #F00;}
</style>
<table width="400" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="red">a</td>
<td class="red">b </td>
<td class="red">c</td>
<td class="red">d</td>
<td class="red">e</td>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
</tr>
<tr>
<td>6</td>
<td>7</td>
<td>8</td>
<td>9</td>
<td>10</td>
</tr>
<tr>
<td>11</td>
<td>12</td>
<td>13</td>
<td>14</td>
<td>15</td>
</tr>
<tr>
<td>16</td>
<td>17</td>
<td>18</td>
<td>19</td>
<td>20</td>
</tr>
<tr>
<td>21</td>
<td>22</td>
<td>23</td>
<td>24</td>
<td>25</td>
</tr>
</table>