Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
 
#1 2007-07-24 16:27:08
- alannie
 - Member
 
- From: Minnesota, USA
 - Registered: 2005-09-15
 - Posts: 150
 
[textile] Table captions in Textile or otherwise?
I am developing a website that has a lot of tables containing scientific data. I’d like to be able to attach a caption to each table.
I haven’t found a way to do this in Textile so I assume there is no Textile code for the table <caption> tag. Is there a way to do this without resorting to raw HTML for the entire table? Here’s an example of the HTML output I’m looking for:
<TABLE>
<CAPTION>Table 1. Cups of coffee consumed by each senator</CAPTION>
<TR>
   <TH>Name</TH>
   <TH>Cups</TH>
   <TH>Type of Coffee</TH>
   <TH>Sugar?</TH>
<TR>
   <TD>T. Sexton</TD>
   <TD>10</TD>
   <TD>Espresso</TD>
   <TD>No</TD>
<TR>
   <TD>J. Dinnen</TD>
   <TD>5</TD>
   <TD>Decaf</TD>
   <TD>Yes</TD>
</TABLE>
					Offline
Re: [textile] Table captions in Textile or otherwise?
Try…
|_\4. Table 1. Cups of coffee consumed by each senator |
| Name | Cups | Type of Coffee | Sugar? |
For more info go to thresholdstate’s textile guide
You can then style your table with css.
Last edited by decoderltd (2007-07-24 18:12:43)
Offline
#3 2007-07-24 21:23:06
- alannie
 - Member
 
- From: Minnesota, USA
 - Registered: 2005-09-15
 - Posts: 150
 
Re: [textile] Table captions in Textile or otherwise?
decoderltd, thanks for the suggestion. that generates an output of:
	<table>
		<tr>
			<th colspan="4">Table 1. Cups of coffee consumed by each senator </th>
		</tr>
		<tr>
			<td> Name </td>
			<td> Cups </td>
			<td> Type of Coffee </td>
			<td> Sugar? </td>
		</tr>
	</table>
That could be a helpful approach. The only problem is that in the site I am developing, the tables also have th cells that have colspans, and I need a way to style the table caption separately from the th cells. I already have CSS styles for the following:
th
th[colspan]
I need a separate CSS selector for the table caption. Ideas?
Offline