ptg16476052
262 LESSON 10: Building Tables
<tr align="center">
<td class="black"><br></td>
<td><img src="blackcircle.png" alt=""></td>
<td class="black"><br></td>
</tr>
</table>
</body>
</html>
Figure 10.15 shows the result.
Output ▼
FIGURE 10.15
Table cell colors.
DO test your tables with various
sizes of browser windows and mobile
devices to make sure they look okay.
DO increase the padding in your table
cells to make them more readable.
DON’T use tables just to put borders
around elements on a page; use CSS.
DON’T use tables just to apply a back-
ground color to an element; use CSS
instead.
DON’T use tables for layout.
DO DON’T
Aligning Your Table Content
Another enhancement that you can make to your tables is to adjust the alignment of
their content. The text-align CSS property aligns content horizontally, whereas the
vertical-align property aligns content vertically, and of course, you can use CSS
properties to accomplish the same things, too. The following sections describe how to use
these attributes in tables.