Found 2417 Articles for HTML

HTML colspan Attribute

George John
Updated on 30-Jul-2019 22:30:26

336 Views

The colspan attribute of the element is used to set the number of columns a header cell should span.Following is the syntax −Above, num is the count of columns a header cell should span.Let us now see an example to implement the colspan attribute of the element −Example Live Demo table, th, td {    border: 2px solid green; } Product Expenses           Expenses               Product Development       500000               Marketing       500000               Services       100000               Support       100000               Maintenance       100000               Total Budget = INR 1300000     OutputIn the above example, we have set the column count to span the header cell −ExpensesThe count is 2, therefore two columns will span the header cell.

HTML