Be able to wrap text around a table, chart or image including above, below, square and tight
13 Layout: Text Wrapping Around Tables, Charts, and Images
What is Text Wrapping?
Imagine you’re in a classroom and a big poster (the table or image) is hanging on the wall. The students (the text) can walk around it, go over it, or stand in front of it. In web design, text wrapping is how the words move around that poster.
Wrapping Types
- Above – the text sits on top of the element.
- Below – the text starts below the element.
- Square – the text wraps around the sides with a little space.
- Tight – the text hugs the element with no extra space.
- Circle (shape‑outside) – the text follows a round shape.
How to Wrap Text Around a Table
Use the CSS float property to pull the table to the left or right, then let the paragraph flow around it.
- Insert the
<table>tag. - Add
style="float:left; margin:0 10px 10px 0;"to give a square wrap. - Write the paragraph after the table.
Example: Text Above a Table
When the table comes after the paragraph, the text appears above it.
| Item | Quantity |
|---|---|
| Apples | 10 |
| Bananas | 5 |
Example: Text Below a Table
Place the table before the paragraph to have the text below.
| Country | Capital |
|---|---|
| France | Paris |
| Japan | Tokyo |
Here’s a quick fact: The area of a circle is $A = \pi r^2$.
Example: Square Wrap (Float Left with Margin)
Use a small margin to give the text a little breathing room.
| Fruit | Color |
|---|---|
| Orange | Orange |
| Blueberry | Blue |
Notice how the words flow around the table, keeping a tidy border.
Example: Tight Wrap (No Margin)
Remove the margin to let the text hug the table.
| Animal | Habitat |
|---|---|
| Penguin | Antarctica |
| Elephant | Savannah |
Now the text is right next to the table, like a tight crowd at a concert.
Example: Circular Wrap (shape‑outside)
Use an image and let the text follow a circle.
Here the words dance around the round shape, just like a carousel 🎠.
Exam Tips
float can be used for square and tight wraps. Add margin for space.
shape-outside: circle(50%) for circular text flow, but test in the browser first.
clear:both; if you need the following content to start on a new line.
Revision
Log in to practice.