Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-01-25 09:47:32

-rr-
Member
Registered: 2005-09-11
Posts: 73

Textile tables not obeying CSS

I’ve tried searching but found nothing on this or either I can’t come up with the correct search.

I’ve bumped into this problem all the time:

Articles containing textile formatted tables will not obey the style sheet, e.g.:

|example txt |example txt |example txt|

with CSS: table th td {font-family: georgia; text-size: small;}
does not make any effect on the table styling.

Giving the table an id within the article doesn’t make any difference.

Only way to make CSS work is to insert the textile CSS tags in every cell. On large tables it defeats the whole purpose of using Textile.

What am I doing wrong?

Offline

#2 2010-01-25 11:30:56

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,538
Website GitHub Twitter

Re: Textile tables not obeying CSS

Hi

have you an url to test that?

Cheers

Offline

#3 2010-01-25 12:04:32

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Textile tables not obeying CSS

table th td {font-family: georgia; text-size: small;}

The selector (table th td) indicates td elements inside a th inside a table. Try:

th, td {font-family: georgia; text-size: small;}

Code is topiary

Offline

#4 2010-01-25 12:57:47

-rr-
Member
Registered: 2005-09-11
Posts: 73

Re: Textile tables not obeying CSS

@jsoo

Thanks but already tried that and other variations. Nothing seems to make tables obey the css. I’m stumped.

This is what the source basically looks like:

<div id="container">
<div id="middle">
<table>
<tbody>
<tr>
<td>example txt</td>
<td>example txt</td>
<td>example txt</td>
</tr>
</table>
</middle>
</div>

Even setting the body CSS to contain the font settings won’t affect the table style in any way.

Last edited by -rr- (2010-01-25 12:58:12)

Offline

#5 2010-01-25 13:27:07

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Textile tables not obeying CSS

Also, text-size is not a valid CSS property. Try font-size.


Code is topiary

Offline

#6 2010-01-25 13:37:59

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: Textile tables not obeying CSS

Well I style the tables on my textpattern sites just fine so it’s not any problem with textile. Must be in the stylesheet itself or a browser overriding with it’s own styling.

Do you use a css reset such as this one ?

I strongly recommend it as it removes any css quirks from browsers. From there use the css suggested above, or simply:

table {font-family: georgia; font-size: small;}

Which will apply the rule to anything contained within the table tags.

Last edited by philwareham (2010-01-25 13:39:08)

Offline

Board footer

Powered by FluxBB