HTML | Tags and Attributes [TABLE] [Width]




Ü To create a table of specific width, we will use the WIDTH attribute in the <TABLE> tag as follows,
          <TABLE WIDTH=50>
            Or
          <TABLE WIDTH=75%>
When we will give the value of the attribute WIDTH in numbers, such as 50, the width of the table will be 50 pixels, and when we will give the value of in percentage, such as 75%, the width of the table will be 75% of the window.

Now we will create a table using these attributes
.
INPUT :
<HTML><HEAD><TITLE>TABLE</TITLE></HEAD>
<BODY>
Sample Table...<BR><BR>
<TABLE BORDER=2 WIDTH=50>
<TR>
<TD>Table width 50 pixels</TD>
</TR>
</TABLE>
<BR>
<TABLE BORDER=4 WIDTH=50%>
<TR>
<TD>Table width 50%</TD>
</TR>
</TABLE></BODY></HTML>
  
OUTPUT:





Recommended Recommends

Comments

Contact Us