Book Image

Practical Web Development

By : Paul Wellens
Book Image

Practical Web Development

By: Paul Wellens

Overview of this book

Table of Contents (23 chapters)
Practical Web Development
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
10
XML and JSON
Index

Tables


Tables are heavily used in HTML documents. If you want to present data in a grid of columns and rows, like in a spreadsheet, you may want to create a table. A cell in a table can not only contain numbers or words, it can even contain an image or ... another table.

By default, the browser will make a judgment call as to how wide each column will have to be, depending on the width of the cell contents and how much room there is for the table overall.

Table elements

The following HTML elements are used to create tables:

<table>

This is the main tag to create a table. Every table begins with a <table> tag and ends with a </table> tag.

<thead> <tbody>

These (optional) elements allow you to separate (and subsequently style) the header part and body part of a table. Like in spreadsheets, the header is used for the descriptions of what goes in the table rows, and the body for the actual content. You can use more than one <tbody> section to better organize (and...