Why is colspan used in table tag in html... | Sololearn: Learn to code for FREE!


Why is colspan used in table tag in html...

I have tried to adjust the colspan in html from 2 to 50 but it does not show any changes in the output.. πŸ˜–πŸ˜–πŸ˜–

9/19/2018 10:08:31 AM

<html>SAMEER POSWAL</html>

9 Answers

New Answer


It means that the cell spans two columns instead of one. You have to use it in the <td></td> tags, not in <table></table>. Without colspan, every cell has the same width: ______ ______ ______ |______|______|______| |______|______|______| |______|______|______| If you use colspan = 2 for the first cell in the second row, it will look like this: ______ ______ ______ |______|______|______| |____________.|______| |______|______|______| Now, the first cell in the second row uses two columns instead of one and there's only two cells in the second row (instead of three). Same with rowspan: ______ ______ ______ |______|______|______| |______|______| | |______|______|______| (last cell spans two rows instead of one)


sameer poswal Thank you! Of course you can follow me. I'm not a pro in html though ☹️


please help me.. I am unable to understand it.


Anna cool tablesπŸ€“.


thanks Anna love youπŸ˜™πŸ˜™


can I follow you Anna..if I need more help from you..πŸ™πŸ™


ohh thanks can you follow me back..


is that you in the profile photo


Remember to drop (leave out or remove) the tds (or ths) you are spanning across. For reference: https://www.w3schools.com/tags/att_colspan.asp