Skip to Content
Web Design in a Nutshell, 3rd Edition
book

Web Design in a Nutshell, 3rd Edition

by Jennifer Robbins
February 2006
Intermediate to advanced
826 pages
63h 42m
English
O'Reilly Media, Inc.
Content preview from Web Design in a Nutshell, 3rd Edition

Column span

In Figure 13-4, <td colspan="2"> tells the browser to make “cell 1” occupy the same horizontal space as two cells—to make it “span” over two columns. The resulting spanned cell is indicated in Figure 13-4. Note that the row containing the spanned cell now only has one td element instead of two.

    <table>
    <tr>
    <tdcolspan="2">Cell 1</td>
    </tr>
    <tr>
    <td>Cell 3</td><td>Cell 4</td>
    </tr>
    </table>
The colspan attribute expands cells horizontally to the right

Figure 13-4. The colspan attribute expands cells horizontally to the right

Setting the colspan to a number greater than the actual number of columns (such as colspan="4" for the example) may cause some browsers to add empty columns to the table , possibly throwing your elements out of alignment.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning Responsive Web Design with HTML5 and CSS3

Beginning Responsive Web Design with HTML5 and CSS3

Jonathan Fielding

Publisher Resources

ISBN: 0596009879Errata Page