MaraGuide
  • Avatar Database
  • Anagram Sam Solver
  • Pet Valuation Tool
  • Battle Guide
  • Crossword Solver
  • Profile Completion
  • Guides
    • Boutique Tracker
    • Missions
    • Mystery Item
    • Microwave Recipes
    • Drew Transformations
    • Glowing Eggs
    • Sultan Tax
  • Mara Flash Games
  • Image Tools
    • Spotify Signature
    • Visitor Counters
    • Profile Status Bar
    • Goal Bar
  • MaraHTML
    • HTML Intro
    • Working With Images
    • Working With Text
    • Adding Links
    • Creating Tables
    • Miscellaneous
    • CSS Intro
    • Styling Boxes
    • Working With Colours
    • Styling Images
    • Styling Tables
    • Styling Text
    • Pseudo Classes
  • Mara:Force Backup
  • Enter MaraGuide


Ads added by hosting provider.
  • Home
  • Avatars
  • Tools
  • Spotify Signature

MaraHTML

Coding resources, tutorials and more.

HTML Tables



Share this page:

A table represents information in a grid format.

Note: The tables used in the example have some basic CSS formatting just to make them easier to follow.


Basic table structure


  • The <table> tag is used to create a table.
  • The <tr> tag indicates the start of a new table.
  • The <td> tag represents an individual cell of a table.
  • The <th> tag is used like the <td> tag but it represents the heading of either a row or column. Even if a cell has no content use the <td> or <th> elements to represent an empty cell.

Now to watch the code in action.

<table>
<tr>
<th></th>
<th>Addow</th>
<th>Arinya</th>
<th>Azul</th>
</tr>
<tr>
<th>Alien</th>
<td></td>
<td><img src="http://images.marapets.com/pets/Arinya_alien.gif"></td>
<td><img src="http://images.marapets.com/pets/Azul_alien.gif"></td>
</tr>
<tr>
<th>American</th>
<td><img src="http://images.marapets.com/pets/Addow_american.gif"></td>
<td><img src="http://images.marapets.com/pets/Arinya_american.gif"></td>
<td></td>
</tr>
</table>

Addow Arinya Azul
Alien
American

Spanning columns and rows


For some tables you need some cells merged together. This is done using the colspan and rowspan attributes.

<table>
<tr>
<th></th>
<th>09:00</th>
<th>10:00</th>
<th>11:00</th>
</tr>
<tr>
<th>Monday</th>
<th rowspan="2">Art</th>
<th colspan="2">Geography</th>
</tr>
<th>Tuesday</th>
<th>Maths</th>
<th>Chemistry</th>
</tr>
</table>

09:00 10:00 11:00
Monday Art Geography
Tuesday Maths Chemistry
Ads added by hosting provider.

MaraGlobe | Rules | Crafted with by Civ
MaraGuide ©