Tuesday, 2 April 2019

The TABLE Tag in html

The <TABLE> tag is actually a rather complex creature, at least insofar as it can accept many different attributes. Some of the attributes are more useful than others, so let's look at the most useful of them as they currently stand:
  • ALIGN. The ALIGN attribute is used to determine where the chart will appear relative to the browser window. Valid values are ALIGN=LEFT and ALIGN=RIGHT. As an added bonus, text will wrap around the table (if it's narrow enough) when the ALIGN=LEFT or ALIGN=RIGHT attributes are used.
  • WIDTH. The WIDTH attribute sets the relative or absolute width of your table in the browser window. Values can be either percentages, as in WIDTH="50%", or absolute values. With absolute values, you must also include a suffix that defines the units used, as in px for pixels or in for inches (e.g., WIDTH="3.5in"). Absolute values for table widths are discouraged, though.
  • COLS. The COLS attribute specifies the number of columns in your table, allowing the browser to draw the table as it downloads.
  • BORDER. The BORDER attribute defines the width of the border surrounding the table. Default value is 1 (pixel).
  • CELLSPACING. The CELLSPACING attribute tells the browser how much space to include between the walls of the table and between individual cells. (Value is a number in pixels.)
  • CELLPADDING. The CELLPADDING attribute tells the browser how much space to give data elements away from the walls of the cell. (Value is a number in pixels.)
It is definitely not necessary to use all of these attributes for your table-in fact, the simple table example earlier didn't use any of them. Often, however, they will come in handy.



<BODY><H2> BigCorp's Computer Systems </H2><P>We use only the highest quality components and software for all of ourWintel computer systems. Plus, if you don't see a configuration you like,call (or email) and let us know. We'll custom build to please!</P> <TABLE><CAPTION>BigCorp's Computer Systems and Specifications</CAPTION> <TR><TH>System 486</TH><TH>System 586</TH><TH>System 686</TH><TR><TD>486DX2-66 CPU</TD><TD>120 MHZ AMD586</TD><TD>200 Mhz Pentium Pro</TD><TR><TD>8 MB RAM</TD><TD>16 MB RAM</TD><TD>16 MB RAM</TD><TR><TD>500 MB HD</TD><TD>1 GB HD</TD><TD>1.4 GB HD</TD><TR><TD>14.4 Modem</TD><TD>28.8 Modem</TD><TD>28.8 Modem</TD><TR><TD>desktop case</TD><TD>minitower case</TD><TD>tower case</TD><TR><TD>DOS/Win 3.1</TD><TD>Windows 95</TD><TD>Windows NT 4.0</TD></TABLE></BODY>

No comments:

Post a Comment