Warning: Trying to access array offset on value of type bool in /home/elpisplus/harublog-elpis.com/public_html/wp-content/themes/cocoon-master/lib/utils.php on line 2602

Warning: Trying to access array offset on value of type bool in /home/elpisplus/harublog-elpis.com/public_html/wp-content/themes/cocoon-master/lib/utils.php on line 2602

Warning: Trying to access array offset on value of type bool in /home/elpisplus/harublog-elpis.com/public_html/wp-content/themes/cocoon-master/lib/utils.php on line 2630

HTML tableタグ内で高さを調整する方法【HTML】

スポンサーリンク

Warning: Trying to access array offset on value of type bool in /home/elpisplus/harublog-elpis.com/public_html/wp-content/themes/cocoon-master/tmp/eye-catch.php on line 19

Warning: Trying to access array offset on value of type bool in /home/elpisplus/harublog-elpis.com/public_html/wp-content/themes/cocoon-master/tmp/eye-catch.php on line 20

Warning: Trying to access array offset on value of type bool in /home/elpisplus/harublog-elpis.com/public_html/wp-content/themes/cocoon-master/tmp/eye-catch.php on line 21
HTML・JavaScript..

こんにちわ、ハル@haru_elpisです。

今回はHTMLでtableタグを使った時、高さの幅を変える方法です。

tableタグのthタグ、tdタグにheightで高さを指定しても変わりません。

それを解決するには「div」タグを使用しCSSでheightを記入する事で、高さが調整できます。

下記が記入例です。

<!DOCTYPE html>
<html lang="ja">
  <head>
    <meta charset="UTF-8">
    <title>tableの高さ調整</title>
    <style>
        td div{
            height: 50px;
        }
    </style>
  </head>
  <body>
     <h1>HTMLの書き方</h1>
        <table border="1">
            <tr>
                   <td><div>りんご</div></td>
                   <td><div>ばなな</div></td>
            </tr>
        </table>
  </body>
</html>

これでtable内のセルの高さを自由に変える事が出来るようになります。

おわりっ

コメント

タイトルとURLをコピーしました