ad

Sunday, October 2, 2022

HTML Table Attribute

web designing theory
HTML Tag



web designing theory


 1) Cell width or column width Tag


The <td>width TO  be set either as an absolute value in pixel, or as in percentage (%)

Program 


<! doctype html>

<html>

<body>

<table border= 1 Width= 400>

<tr>

<td width=30%>

cell width is 30%

</td>

<td width = 70%>

cell width is 70% 

</td></tr>

</table>

</body>

</html>


 Cell width or column width output


Cell width and column width


2) TR Tag 

HTML table

TR ( tag) represents a Table Row and is utilized to add rows to the table. Data HTML tables are placed into rows. The fundamental components of an HTML table are the table rows. A table's rows do not have any data directly. TR tag HTML specifies a row within a table and the element includes one or multiple or elements. These and hold the table information. Arranged Table Row Basic tables typically include a parent componentalong with several table row. serves as a parent element for the row that includes table headers. servesas a parent container forone or more rows that include summary information regarding the data in each column ofthe table. serves as a parent element for the data rows display in a table. 

1) determines the horizontal alignment for the content within each defines the vertical alignment for all elementswithin a table row. 

2) bgcolor=" "> defines the background color for an individual table row in an html. 

3) specifies the URL of a file to be utilized as a background image for a table row. 

4) specifies the border color for everyinner border of a table row element of a table row. 

 

Program 

<! Doctype html>
<html>
<body>
<table>
  <tr>
    <th>Month</th>
    <th>Savings</th>
  </tr>
  <tr>
    <td>January</td>
    <td>$100</td>
  </tr>
  <tr>
    <td>February</td>
    <td>$80</td>
  </tr>
</table>
</body>
</html>
 

TD Tag output



Tr Tag web designing theory




 3) TH Tag

  The tag can be used to define table headings. The TH tag is utilized when we want to include heading text within a table column, thereby replacing the tag with . TH TAG  will designate your top row as the table header as illustrated below, thus you utilize the element in the first row. TH TAG headings defined within the tag are bold and centered by default

Program 

<! Doctype html>

<html>

<table border= 2>

<tr>

<th>A </th>

<th>Heading</th>

<th>Row</th></th>

<tr>

<td>The first</td>

<td>row of </td>

<td>table data</td></tr>

</tr>

<td>the second</td>

<td>row of</td>

<td>table date</td>

</td></table>

</html>


TH Tag output

Th Tag output


4) TD Tag

The  TD TAG element specifies a regular cell or column within an HTML table. This tag needs to be placed within a tag. The information in the TD TAG indicates that this element is left-aligned by default. It can be stated that a column is essential for finishing a table in HTML

 

Program 

<! Doctype html>

<html>

<body>

<table>

  <tr>

    <td>Cell A</td>

    <td>Cell B</td>

  </tr>

  <tr>

    <td>Cell C</td>

    <td>Cell D</td>

  </tr>

</table>

</body>

</htm>


TD Tag output


TD Tag



Related Post :-

html form pattern attribute

html frame tag

css table property

No comments:

Post a Comment