Создание ячейки заголовка таблицы с помощью элемента th.
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Header cells</title> <style> table { margin-bottom: 2em; } td, th { border: 1px solid #999; padding: 0.1em 1em; } </style> </head> <body> <table> <tr> <th>Cats</th> <th>Dogs</th> <th>Lemurs</th> </tr> <tr> <td>Tiger</td> <td>Grey Wolf</td> <td>Indri</td> </tr> <tr> <td>Cheetah</td> <td>Cape hunting dog</td> <td>Sifaka</td> </tr> <tr> <td>Caracal</td> <td>Red fox</td> <td>Brown lemur</td> </tr> <tr> <td>Wildcat</td> <td>Fennec</td> <td>Dwarf lemur</td> </tr> </table> <table> <tr> <th>Cats</th> <td>Tiger</td> <td>Cheetah</td> <td>Caracal</td> <td>Wildcat</td> </tr> <tr> <th>Dogs</th> <td>Grey Wolf</td> <td>Cape hunting dog</td> <td>Red fox</td> <td>Fennec</td> </tr> <tr> <th>Lemurs</th> <td>Indri</td> <td>Sifaka</td> <td>Brown lemur</td> <td>Dwarf lemur</td> </tr> </table> </body> </html>
Страницы в тему:
- Базовая таблица
- Таблицы(Продвинутый урок HTML)