Comment spécifier la largeur et la hauteur du tableau

Exemple d'analyse :

table{width:100%;}

th,td{height:50px;}

Utilisez l'attribut width pour définir la largeur de l'ensemble du tableau, et utilisez l'attribut height pour définir la largeur de chaque tableau. La hauteur des cellules.


Formation continue
||
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>php中文网(php.cn)</title> <style> table,td,th { border:1px solid black; } table { width:100%; } th,td { height:50px; } </style> </head> <body> <table> <tr> <th>姓名</th> <th>年龄</th> </tr> <tr> <td>Peter</td> <td>20岁</td> </tr> <tr> <td>Griffin</td> <td>23岁</td> </tr> </table> </body> </html>
soumettreRéinitialiser le code
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!