Found 2416 Articles for HTML

How to create an ordered list in HTML?

Lokesh Badavath
Updated on 24-Nov-2023 00:35:52

2K+ Views

An ordered list is a numbered list of items. It gives you the ability to control the sequence number in the context. Allow us to group a set of related items in lists. HTML supports ordered list and an unordered list. To create ordered list in HTML, we have to use the tag. We use tag to start list of items within the ordered list tag. The list of items can be marked as numbers, lowercase letters uppercase letters, roman letters, etc. The default order is numbers for list items in the context. The tag should ... Read More

How to use an HTML tag inside HTML table?

Lokesh Badavath
Updated on 18-Oct-2022 10:57:56

5K+ Views

We can easily add HTML tag inside a table. The HTML tag should be placed inside the tag. For example, adding a paragraph … tag or other available tags inside the tag. Syntax Following is the syntax to use an HTMl tag inside HTML table. Paragraph of the context Example 1 Given below is an example to use an HTML tag inside HTML table. DOCTYPE html> ... Read More

How to add space around table border in HTML?

Lokesh Badavath
Updated on 18-Oct-2022 10:55:38

7K+ Views

We use the CSS property border-spacing, to set border spacing for an HTML table. It adds space around the table border between the adjacent cells in a table. We should specify the value in pixels for the border-spacing property to add. Syntax Following is the syntax for adding space around table border in HTML. border-spacing: 10px; Example 1 Given below is an example where we are creating a table and trying to add spaces around it. DOCTYPE html> ... Read More

How to center align text in table cells in HTML?

Lokesh Badavath
Updated on 31-Aug-2023 02:10:42

117K+ Views

We use the CSS property text-align, to center align text in table cells. We use inline, internal style sheet for text alignment in table cells. The text-align property of CSS sets the alignment of the content in and . By default, the content of are center-aligned and the content of are left-aligned. We can override the attribute by other to change the alignment. We can also change the align-value to left and right. Syntax Following is the syntax to center align text in tag of the table. Table header... Following is the syntax to center ... Read More

How to create a table with a caption?

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

620 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

14K+ 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

31K+ 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

2K+ 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

41K+ 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

55K+ 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

Advertisements