Tạo độ rộng cho từng cột trong Table
Html 2017
<!DOCTYPE html> <html> <head> <style> table, th, td { border: 1px solid black; } </style> </head> <body> <table> <colgroup> <col width="80" span="2"> <col width="150" span="1"> <col width=auto span="2"> <col width="200" span="1"> </colgroup> <tr> <th>ISBN</th> <th>Title</th> <th>Price</th> <th>ISBN</th> <th>Title</th> <th>Price</th> </tr> <tr> <td>80px</td> <td>80xp</td> <td>150px</td> <td>Auto</td> <td>Auto</td> <td>200px</td> </tr> </table> </body> </html>
Output:
ISBN | Title | Price | ISBN | Title | Price |
---|---|---|---|---|---|
80px | 80xp | 120px | Auto | Auto | 200px |
Test: https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_colgroup_test
Run demo
0 nhận xét:
Post a Comment