patternhtmlModerate
Practicing HTML Tables
Viewed 0 times
tableshtmlpracticing
Problem
I am trying to learn by doing. Here is the first problem that I have solved. I have actually not done it perfectly. The table header should cover both the text and the image but it is only above text. If you can help me out with the design I will be thankful.
Untitled Document
Food you love to eat
I love eating food . All types of food are good for health. I like fruits in them. Fruits are good for health.
Solution
The HTML you submitted was invalid. I changed the following things so your html would be valid:
-
Don't put `
Your HTML validated:
-
Don't put `
tags inside a table. Header tags are used for headings only. Don't use headings to make text BIG or bold. Use CSS for positioning and font sizing.
-
In a table, the tag is the first tag that should appear.
-
In the tag, the attribute alt is required. The alt` attribute specifies alternate text for an image if the image cannot be displayed.Your HTML validated:
Untitled Document
Food you love to eat
I love eating food . All types of food are good for health. I like fruits in them. Fruits are good for health.
Code Snippets
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<h3>Food you love to eat</h3>
<table>
<tr>
<td>I love eating food . All types of food are good for health. I like fruits in them. Fruits are good for health.</td>
<td width="170"> <img src ="http://www.htmliseasy.com/exercises/fruitbowl.gif" alt="Fruit Bowl" /> </td>
</tr>
</table>
</body>
</html>Context
StackExchange Code Review Q#3204, answer score: 12
Revisions (0)
No revisions yet.