<td> Block or Inline | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

<td> Block or Inline

Question for all you coding gurus out there. Is <td> considered block or inline? For example, if it is inline then I would not be able to code <td> <div></div></td>. If it is block, then I would be able to (I think?). I'm asking so I can determine whether or not I can use <span> with a table data cell in order to integrate CSS with it or add some sort of colour. Thanks!

14th Jul 2018, 5:10 PM
Brett Surbey
Brett Surbey - avatar
3 Answers
+ 3
Brett Surbey try it and see what happens.
14th Jul 2018, 5:23 PM
Manual
Manual - avatar
+ 1
Good point!
14th Jul 2018, 5:34 PM
Brett Surbey
Brett Surbey - avatar
+ 1
I guess the short answer is that it depends. The technical answer is: Default CSS Settings Most browsers will display the <td> element with the following default values: td { display: table-cell; vertical-align: inherit; } (citation: https://www.w3schools.com/tags/tag_td.asp )
14th Jul 2018, 11:20 PM
Janning⭐
Janning⭐ - avatar