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:





Author: Tanmay Chakrabarty

Tanmay Chakrabarty is a former CSE student, currently working as a Senior Software Engineer with 5+ years of experience in the field of Web Application development in PHP+MySQL platform with strong skills in Javascript, JQuery, JQuery UI and CSS. He tries to write notes every week but fails due to heavy loads of duty.

Recommended Recommends

Comments

Contact Us