Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-19-2012, 09:41 AM   PM User | #1
CrashNsink
New Coder

 
Join Date: Apr 2012
Location: Under your bed.
Posts: 29
Thanks: 6
Thanked 0 Times in 0 Posts
CrashNsink is an unknown quantity at this point
Question Table formatting issues =(

The following is my current table layout -

Code:
<table>
			<thead>
			<tr>
				<th>Date</th>
				<th>Time</th>
				<th>Description</th>
			</tr>
			</thead>
			
			<tbody>
			<tr>
				<td>Oct 31</td>
				<td>6:00pm-8.00pm</td>
				<td>Spooky stories read aloud (for kids 2-12)</td>
			</tr>
			
			<tr>
				<td rowspan="2">Nov 2</td>
				<td>12.30p-1.30p </td>
				<td>7.00p-8.00p</td>
				<td rowspan="2">Sam Miller reads from <i>Lunchtime Chronicles</i> </td>
			</tr>
			
			<tr>
				<td>Nov 3</td>
				<td>5.30p-7.00p</td>
				<td>Cookbook Reading Club monthly discussion</td>
			</tr>
			
			<tr>
				<td>Nov 4</td>
				<td>5.30am-6.45am</td>
				<td>"Fitness in the Stacks" Pilates class</td>
			</tr>
			
		</tbody>
		</table>
I need to achieve something like this, but I can't do it

Thanks for any help rendered
CrashNsink is offline   Reply With Quote
Old 05-19-2012, 10:28 AM   PM User | #2
Lerura
Regular Coder

 
Lerura's Avatar
 
Join Date: Aug 2005
Location: Denmark
Posts: 869
Thanks: 0
Thanked 112 Times in 111 Posts
Lerura will become famous soon enough
rowspan spans the cell through 2 <tr>s.
And not as you are attempting: make 2 rows with the same <tr>
with
Code:
<tr>
<td rowspan="2">Nov 2</td>
<td>12.30p-1.30p </td>
<td>7.00p-8.00p</td>
<td rowspan="2">Sam Miller reads from <i>Lunchtime Chronicles</i> </td>
</tr>
the bottom half of the first and fourth <td> will be expanded to the third <tr>
and the <td>s defined in the third <tr> will then occupy the columns that are not already ocuppied by the expanded <td>s from the second <tr>.

The code is easyly fixed by moving the third cell to it's own <tr>
Code:
<table>
			<thead>
			<tr>
				<th>Date</th>
				<th>Time</th>
				<th>Description</th>
			</tr>
			</thead>
			
			<tbody>
			<tr>
				<td>Oct 31</td>
				<td>6:00pm-8.00pm</td>
				<td>Spooky stories read aloud (for kids 2-12)</td>
			</tr>
			
			<tr>
				<td rowspan="2">Nov 2</td>
				<td>12.30p-1.30p </td>
				<td rowspan="2">Sam Miller reads from <i>Lunchtime Chronicles</i> </td>
			</tr>
			<tr>

				<td>7.00p-8.00p</td>

			</tr>
			
			<tr>
				<td>Nov 3</td>
				<td>5.30p-7.00p</td>
				<td>Cookbook Reading Club monthly discussion</td>
			</tr>
			
			<tr>
				<td>Nov 4</td>
				<td>5.30am-6.45am</td>
				<td>"Fitness in the Stacks" Pilates class</td>
			</tr>
			
		</tbody>
		</table>
the first and column of this new <tr> is already occupied by the spanned <td>s from the row above, so in this <tr> you only have to define what should be in the second <td> / column.
Lerura is offline   Reply With Quote
Users who have thanked Lerura for this post:
CrashNsink (05-19-2012)
Old 05-19-2012, 01:34 PM   PM User | #3
CrashNsink
New Coder

 
Join Date: Apr 2012
Location: Under your bed.
Posts: 29
Thanks: 6
Thanked 0 Times in 0 Posts
CrashNsink is an unknown quantity at this point
Thanks alot for the help

The way rows interact with one another is kinda confusing ..
CrashNsink is offline   Reply With Quote
Reply

Bookmarks

Tags
css, html, table

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:39 AM.


Advertisement
Log in to turn off these ads.