Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2006-07-04 11:36:34
- Ace of Dubs
- Member

- Registered: 2006-04-17
- Posts: 446
Adding classes to tables
I recently stumbled across a great resource for Textiling
The only thing I cant figure out is how I can add a class to my tables.
I know you can add a class to other elements like so:
p(example1)
But since tables have no identifying tag in Textile there seems to be no way to style them with CSS.
argh
Offline
Re: Adding classes to tables
From the source:
table{border:1px solid black}.
|_. this|_. is|_. a|_. header|
<{background:gray}. |\2. this is|{background:red;width:200px}. a|^<>{height:200px}. row|
|this|<>{padding:10px}. is|^. another|(bob#bob). row|
renders this:
| this | is | a | header |
|---|---|---|---|
| this is | a | row | |
| this | is | another | row |
Works with classes, too:
table(aClass).
|_. this|_. is|_. a|_. header|
<{background:gray}. |\2. this is|{background:red;width:200px}. a|^<>{height:200px}. row|
|this|<>{padding:10px}. is|^. another|(bob#bob). row|
renders this:
| this | is | a | header |
|---|---|---|---|
| this is | a | row | |
| this | is | another | row |
Hit “Quote” for Textile code!
Offline
#3 2006-07-05 17:58:48
- Ace of Dubs
- Member

- Registered: 2006-04-17
- Posts: 446
Re: Adding classes to tables
You kick so much ass it aint funny
Cheers!
Offline
#4 2006-07-06 18:17:25
- Ace of Dubs
- Member

- Registered: 2006-04-17
- Posts: 446
Re: Adding classes to tables
Pop quiz hotshot..
How do you add classes to unordered lists?
I tried <code>ul(class)</code> and <code>list(class)</code> and even <code>unorderedlist(class)</code> but so far no dice :(
Offline
Re: Adding classes to tables
*(aClass) you
* are
* welcome!
next?
Offline
#6 2006-07-06 22:15:58
- Ace of Dubs
- Member

- Registered: 2006-04-17
- Posts: 446
Re: Adding classes to tables
Nicely executed!
Makes me wish that Textism would make a HTML to Textile box so I could figure this out on my own.
Offline
#7 2006-07-06 22:23:17
- Ace of Dubs
- Member

- Registered: 2006-04-17
- Posts: 446
Re: Adding classes to tables
Ok…heres another one.
How would you assign individual classes to table headers?
Offline
Re: Adding classes to tables
Never. I’d use descendant selectors.
Offline
#9 2006-07-07 11:25:37
- Ace of Dubs
- Member

- Registered: 2006-04-17
- Posts: 446
Re: Adding classes to tables
You’re just saying that cause you dont know the answer ;)
Seriously though, I have a table whose table-headers will be replaced with different images. Other than inline styling, classes are the only way I know to do this.
Offline
Re: Adding classes to tables
|_(class1). a|_(class2). b|
| think | once |
| more | dude |
I think we shall extend this into the winter eason. More fun than watching paint dry, anyway.
Offline
#11 2006-07-07 13:44:17
- masa
- Member
- From: North Wales, UK
- Registered: 2005-11-25
- Posts: 1,095
Re: Adding classes to tables
I think you’ve invented a new recreational activity: markup tennis.
It’s clear who’s going to win the current match though.
Offline
#12 2006-07-07 14:25:13
- Ace of Dubs
- Member

- Registered: 2006-04-17
- Posts: 446
Re: Adding classes to tables
LOL
I think I got “tennis brain” from too much TXPing
and yeah..I am clearly no match for Mr. Nadal here.
But rest assured, this wont be the last you hear of me! (limps away nursing bruised cerebral cortex)
Edit: (Drinks a full liter of espresso and returns for more punishment)
Alright tough guy, see if you can handle this
<code><dl class=“123”>
<dt class=“456”>
<dd class=“789”></dd>
</dt>
</dl></code>
or even this
<code><div class=“123” id=“456”>Ha!</div></code>
Be gentle…my brain still hurts!
Last edited by Ace of Dubs (2006-07-07 14:41:21)
Offline