From the course: HTML: Tables

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Use colspan and rowspan

Use colspan and rowspan - HTML Tutorial

From the course: HTML: Tables

Start my 1-month free trial

Use colspan and rowspan

- [Instructor] Now that we've grouped some of these columns together and we're showing a relationship between this type of data what if we wanted to add a big label across the top of all of those rows? Like right now I've got some red columns and some blue columns, but it's not necessarily obvious as to why some are red and why some are blue. It might be really, really nice to have a label over top of all of those. And so let's go on ahead and add that now. So the way I'm going to do that is inside of my T head before I have all of this information about the headers for each one of those columns I'm just going to put in another row. So start with a TR, end with a /TR, and then inside of that I am going to map out a row for those particular labels. So in that particular case we're going to start with a td. That is where the cell would go above item, but I don't actually need this cell. However, in order to keep all of my data lined up in this table I will have to put in basically what…

Contents