Difference between colspan and span | Sololearn: Learn to code for FREE!

+2

2 Answers

New Answer

+6

colspan attribute is used to set the number of columns a cell should span in a table. Span element is a generic inline container for phrasing content, which does not inherently represent anything.

+2

<span> is an inline tag https://developer.mozilla.org/en-US/docs/Web/HTML/Element/span meanwhile colspan is an attribute only valid for <th> oΕ• <td> table tags https://developer.mozilla.org/en-US/docs/Web/HTML/Element/table#complicated_tables