The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Making a table column span multiple, Using Colspan correctly
whosaidmoo
post Dec 8 2014, 01:13 AM
Post #1





Group: Members
Posts: 6
Joined: 8-December 14
Member No.: 21,907



Hey I am trying to build a website and I





<!doctype html

<html
<head
<title Jared’s Webpage </title

</head
<body


<table border=”1” cellpadding=”8”
<tr style="display:table-row"
<th colspan=”3” Contact Info </th <--! This is where I need help I am trying to make this span all 3 columns as the header!-->
</tr
<tr cellpadding="1"
<th Email</th
<th About Me</th
<th Twitter</th
</tr
<tr
<td <a href=”mailto:jared@jared.com Jared@jared.com</a </td
<td <a href=”http://about.me/JaredMagid” About Me </a </td
<td @JaredMagid</td
</tr
</table

</body
</html
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Dec 8 2014, 01:31 AM
Post #2


Jocular coder
********

Group: Members
Posts: 2,460
Joined: 31-August 06
Member No.: 43



CODE

<th colspan=”3” Contact Info </th <--! This is where I need help I am trying to make this span all 3 columns as the header!-->


The syntax seems to be all messed up. A 'th' element must start with <th> and end with </td>. When you add bits like "colspan=3", they go inside the angle brackets, separated by spaces. (The quotes are not required around pure alphanumerics like '3'.)

So try

CODE

<th colspan=3>Contact Info </th> <--! Should be ok now!-->
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
whosaidmoo
post Dec 8 2014, 03:11 AM
Post #3





Group: Members
Posts: 6
Joined: 8-December 14
Member No.: 21,907



Thank you Brian! That worked very nicely!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Dec 8 2014, 08:59 AM
Post #4


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



whosaidmoo, Brian made a typo. The example was correct, but before that he wrote this:

QUOTE
A 'th' element must start with <th> and end with </td>


A TH should of course end with </th>, not </td>.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 24th April 2024 - 02:30 PM