Found 2202 Articles for HTML

How to create a table with a caption?

Lokesh Badavath
Updated on 18-Oct-2022 10:52:20

838 Views

We use the tag, to create a table with caption in HTML. The caption tag will be inserted immediately after the tag. We can add only one caption for one table. By default, the alignment of this tag is center. We can change the alignment using CSS property called align. Syntax Following is the syntax of the caption tag of HTML Caption of the table... Example 1 In the following example we are creating a table with employee name and employee id with Employees as the caption. DOCTYPE html> ... Read More

How to create a collapsed border in HTML?

Lokesh Badavath
Updated on 18-Oct-2022 10:50:33

16K+ Views

We use border-collapse property to create a collapsed border in HTML. The border-collapse is a CSS property used to set the table borders should collapse into a single border or be separated with its own border in HTML. Border-collapse property has four values: separate, collapse, initial, inherit. With the value collapse If you pass collapse as a value of the border-collapse Property, the borders of the table are simply collapsed into a single border. Following is the syntax to create a collapsed border in HTML. border-collapse: collapse; Example 1 In the example given below we are trying to ... Read More

How to create table border in HTML?

Fendadis John
Updated on 10-Sep-2023 07:53:04

33K+ Views

To create table border in HTML, the border attribute was used. But the introduction of HTML5, deprecated the border tag. Create table border using the CSS property border. Set table border as well as border for and .ExampleYou can try to run the following code to create a border in the table in HTML. We’re using tag here:                    table, th, td {             border: 1px solid black;          }                     Employee Details                             Name             Amit             Sachin                                 Age             27             34                     Output

How to set horizontal header for a table?

Lokesh Badavath
Updated on 18-Oct-2022 10:48:06

3K+ Views

Tables in HTML can have horizontal header and vertical header. For the horizontal header, we need to set all inside a single  tag. Syntax Following is the syntax to set horizontal header for a table − horizontal header1… horizontal header2… Example 1 Now let us see an example program to set horizontal header for a table. DOCTYPE html> table, tr, th, ... Read More

What are table rowspan and colspan in HTML?

Lokesh Badavath
Updated on 06-Sep-2023 14:05:41

44K+ Views

The rowspan and colspan are the attributes of tag. These are used to specify the number of rows or columns a cell should merge. The rowspan attribute is for merging rows and the colspan attribute is for merging columns of the table in HTML. These attributes should be placed inside the tag as shown in the image given below − Syntax Following is the syntax to merge table cells in HTML − cell data cell data Example 1 − Setting the rowspan Now let us look at an example where we set the rowspan of the ... Read More

How to merge table columns in HTML?

Anjana
Updated on 02-Sep-2023 13:42:42

67K+ Views

To merge table columns in HTML use the colspan attribute in tag. With this, merge cells with each other. For example, if your table is having 4 rows and 4 columns, then with colspan attribute, you can easily merge 2 or even 3 of the table cells.ExampleYou can try to run the following code to merge table column in HTML. Firstly, we will see how to create a table in HTML with 3 rows and 3 columns                    table, th, td {             border: ... Read More

How to merge table cells in HTML?

Lokesh Badavath
Updated on 02-Sep-2023 13:15:09

78K+ Views

We use the colspan and rowspan attribute, to merge cells in HTML. The rowspan attribute is for the number of rows a cell should merge, whereas the colspan attribute is for the number of columns a cell should merge. The attribute should be placed inside the tag. Syntax Following is the syntax to merge table cells in HTML. cell data Example Following is the example program to merge the row cells of the table in HTML. DOCTYPE html> table, tr, th, td { ... Read More

How to set cell width and height in HTML?

Lokesh Badavath
Updated on 10-Sep-2023 08:02:31

42K+ Views

We use the inline CSS style, to set the cell width and height. The HTML style element contains width and height attributes. To set cell width and height we should place these attributes with specified values with pixels inside the tag. Syntax Following is the syntax to set cell width and height in HTML. content Example Following is the example program to set cell width and height in HTML. DOCTYPE html> table, tr, th, td { border:1px solid ... Read More

How to set cell padding in HTML?

Lokesh Badavath
Updated on 02-Sep-2023 15:53:32

51K+ Views

We use the inline style attribute, to set cell padding in HTML. Cell padding is the space between cell borders of the table and the content within a cell of the table. The style attribute is used inside the HTML tag, with the CSS property called padding with a specified value in pixels. Syntax Following is the syntax to set cell padding in HTML. table header Example Following is an example program to set cell padding in HTML. DOCTYPE html> table, th, td { ... Read More

How to markup postal address in HTML?

Lokesh Badavath
Updated on 11-Nov-2022 09:20:03

3K+ Views

Addresses are used in physically locating a building. An address is a information, presented in a fixed format, used to give the location of a building, apartment, along with other identifiers are used such as house or apartment numbers. We use tag, to provide contact details on the web page. The HTML tag defines the contact information for the author of a document or an article on the web page. The contact information can be a building location, email address, URL, phone number, etc. The text in the element usually renders in italic format, and it ... Read More

Advertisements