td {
width: 100px;
height: 50px;
}
| width | セルの横幅を指定します |
|---|---|
| height | セルの高さを指定します |
それぞれ 数値+単位(px、他)か %(割合)で指定します。
※デフォルトは auto(自動)です。(例:width: auto)
<html>
<head>
<title>TAG index Webサイト</title>
<style type="text/css">
<!--
table, th, td {
border: 2px #2b2b2b solid;
}
td {
height: 100px;
}
#example1 { width: 200px; }
#example2 { width: 300px; }
-->
</style>
</head>
<body>
<table>
<tr>
<th id="example1">ホスティング</th>
<th id="example2">ホームページ制作</th>
</tr>
<tr>
<td>サーバーA社</td>
<td>WebデザインA社</td>
</tr>
</table>
</body>
</html>
▼これをブラウザで見ると次のように表示されます
| ホスティング | ホームページ制作 |
|---|---|
| サーバーA社 | WebデザインA社 |