Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Titre du document</title> <style> th,td { border: 2px solid #666; } table.t1 { table-layout: fixed; width: 250px; } table.t2 { table-layout: auto; width: 100%; } </style> </head> <body> <h2>Exemple de la propriété table-layout</h2> <h3>Table-layout: fixed; width: 160px</h3> <table class="t1"> <tr> <th>Pays</th> <th>Capitale</th> <th>Ville</th> </tr> <tr> <td>Russie</td> <td>Moscou</td> <td>Saint Petersbourg</td> </tr> <tr> <td>Anglais</td> <td>Londre</td> <td>Manchester</td> </tr> <tr> <td>Les Pays-Bas</td> <td>Amsterdam</td> <td>Haage</td> </tr> </table> <h3>Table-layout: auto; width: 100%</h3> <table class="t2"> <tr> <th>Pays</th> <th>Capitale</th> <th>Ville</th> </tr> <tr> <td>Russie</td> <td>Moscou</td> <td>Saint Petersbourg</td> </tr> <tr> <td>Anglais</td> <td>Londre</td> <td>Manchester</td> </tr> <tr> <td>Les Pays-Bas</td> <td>Amsterdam</td> <td>Hague</td> </tr> </table> </body> </html>