+ 24
What is ["colspan = "2"]? ooooo .... O.o! ! !
7 Respostas
+ 22
Thanks for the answer but I do not see the difference, see if you look at the code!
<table border="2">
<tr>
<td>Red</td>
<td>Blue</td>
<td>Green</td>
</tr>
<tr>
<td><br /></td>
<td colspan="3"><br /></td>
</tr>
</table>
+ 12
The colspan attribute defines the number of columns a table cell should span. In your case, two columns.
Explanation and examples:
https://www.w3schools.com/Tags/att_colspan.asp
+ 10
Vučko/Вучко/Vuchko, perhaps this code will help you to see the difference😊
https://code.sololearn.com/Wqeb7b7rgcUj/?ref=app
+ 6
Table cells can span across more than one column or row. The attributes COLSPAN (“how many across”) and ROWSPAN (“how many down”) indicate how many columns or rows a cell should take up
Read more: https://html.com/attributes/td-colspan/#ixzz5FHoMN4TJ
+ 3
Vuchko, you cannot see the difference because your table only has 3 columns in total. Colspan defines the maximum number of columns the entry can cross. If you only have 2 columns and define colspan="3", than the entry will only be 2 wide, not 3.
Perhaps you can see better with this:
<table border="2" width="100%">
<tr>
<td>Red</td>
<td>Blue</td>
<td>Green</td>
<td>4th column</td>
</tr>
<tr>
<td><br /></td>
<td colspan="3">3 columns across</td>
</tr>
<tr>
<td></td>
<td colspan="2">only 2 columns across</td>
<td></td>
</tr>
</table>
0
It means the column should cover extra column by one flow
0
It merges two columns in a table