• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 14. Working with Links, Lists, a... > The <TABLE> Element: Creating Tables

The <TABLE> Element: Creating Tables

As mentioned in the beginning of the chapter, tables are great for letting you format text. Tables started off just as rectangular grids of cells containing text, but they’ve taken off from there, and now support images, column groups, footers, headers, and so on. Here’s a basic table to get us started. You create the table with the <TABLE> element, create the rows in the table with the <TR> element, the headers for columns with <TH> elements, and display the actual data in each cell with the <TD> element:

(Listing 14-09.html on the web site)

<HTML> 
    <HEAD> 
        <TITLE> 
            HTML Tables 
        </TITLE> 
    </HEAD> 

    <BODY> 
        <H1> 
            HTML Tables 
        </H1> 
        <TABLE BORDER="1"> 
            <TR> 
                <TH ROWSPAN="3">Tic<BR>Tac<BR>Toe</TH> 
                <TD>X</TD> 
                <TD>O</TD>  
                <TD>X</TD> 
            </TR> 
            <TR> 
                <TD>O</TD> 
                <TD>X</TD> 
                <TD>O</TD> 
            </TR> 
            <TR> 
                <TD>X</TD> 
                <TD>O</TD> 
                <TD>X</TD> 
            </TR> 
        </TABLE> 
    </BODY> 
</HTML> 

					  


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint