Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2007-12-26 15:33:58
- Joey
- Member
- From: Netherlands
- Registered: 2005-01-19
- Posts: 257
[textile] Adding cellspacing and summary and a caption to a textile table
I was wondering if I can somehow add the cellspacing
and summary
attributes to a textile table, and if I can add a <caption>
. I searched on the textile site, but couldn’t find it.
Regards,
Joey
Offline
#2 2007-12-26 16:06:53
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: [textile] Adding cellspacing and summary and a caption to a textile table
Interesting,
Try this…
table(class#id).
| Muppet | Email |
| Kermit | kermit@muppets.com |
Which produces this XHTML at http://textile.thresholdstate.com/ …
<table class="class" id="id">
<tr>
<td> Muppet </td>
<td> Email </td>
</tr>
<tr>
<td> Kermit </td>
<td> kermit@muppets.com </td>
</tr>
</table>
You can then use css to style as needed.
However, the above example renders like this on the forum (look at the source and you’ll see missing class and id)…
Muppet | |
Kermit | kermit@muppets.com |
You can also make a row into header cells…
|_. Muppet |_. Email |
| Kermit | kermit@muppets.com |
Looks like this on the forum (look at source to see the mods)…
Muppet | |
---|---|
Kermit | kermit@muppets.com |
Edit: Sorry, I don’t know how to get textile to add a caption.
Regards,
Last edited by net-carver (2007-12-26 16:09:37)
— Steve
Offline
#3 2007-12-26 16:20:24
- Joey
- Member
- From: Netherlands
- Registered: 2005-01-19
- Posts: 257
Re: [textile] Adding cellspacing and summary and a caption to a textile table
Thanks Steve for your reply. However, you can’t style your table 100% with CSS. In my opinion if you don’t want any gutters between your cells you always need to specify the cellspacing
to zero, and then you can use CSS to style further. So, I need to do this in textile:
<table class="class" cellspacing="0"></table>
The class
attribute works like you explained, but what about the cellspacing
?
Regards,
Joey
Offline
#4 2007-12-26 16:33:08
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: [textile] Adding cellspacing and summary and a caption to a textile table
Joey,
AFAIK, that’s not possible. You can use curly-brace {...}
notation to add inline styles but not the cellspacing attribute.
You might have to resort to normal xhtml notation in this case. (Or some js if you can live with it on your site.)
— Steve
Offline
#5 2007-12-26 16:42:52
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: [textile] Adding cellspacing and summary and a caption to a textile table
Joey wrote:
In my opinion if you don’t want any gutters between your cells you always need to specify the cellspacing to zero
Wouldn’t td {margin:0;}
in your CSS do the same?
Table caption and summary are as far I know not possible with Textile.
Offline
#6 2007-12-26 16:50:03
- Joey
- Member
- From: Netherlands
- Registered: 2005-01-19
- Posts: 257
Re: [textile] Adding cellspacing and summary and a caption to a textile table
It should do the same but I thought a lot of browsers still use the cellspacing
attribute. Just make a test site and you will see it.
Regards,
Joey
Offline
#7 2007-12-26 16:51:31
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: [textile] Adding cellspacing and summary and a caption to a textile table
Joey
do you have the luxary of ignoring internet explorer for your project? If so, you should be able to use border-spacing: 0;
in your css. Otherwise I think border-collapse: collapse;
might do it for you.
— Steve
Offline
#8 2007-12-26 16:56:25
- Joey
- Member
- From: Netherlands
- Registered: 2005-01-19
- Posts: 257
Re: [textile] Adding cellspacing and summary and a caption to a textile table
Yup, that does the trick in all browsers but IE. So now I should make choice: either use Textile and let the table be easy to modify in Textpattern or use XHTML and make it somewhat difficult to maintain.
Regards,
Joey
Offline
#9 2007-12-26 17:00:45
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: [textile] Adding cellspacing and summary and a caption to a textile table
This seems to do it for me (viewing in Firefox)…
table(class#id){border-collapse: collapse;}.
|_. Muppet |_. Email |
| Kermit | kermit@muppets.com |
The forum doesn’t seem to be showing it correctly but try it over at threshold state and all seems well.
If it does work, just move the inline stuff to your css file.
Hope that helps.
Last edited by net-carver (2007-12-26 17:01:52)
— Steve
Offline
#10 2007-12-26 17:32:32
- Joey
- Member
- From: Netherlands
- Registered: 2005-01-19
- Posts: 257
Re: [textile] Adding cellspacing and summary and a caption to a textile table
Yes it does, but not in IE I think.
Regards,
Joey
Offline
#11 2007-12-27 00:56:50
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: [textile] Adding cellspacing and summary and a caption to a textile table
AFAIK, IE/Win does support border-collapse: collapse;
but IE/Mac doesn’t.
— Steve
Offline
Offline