Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2019-03-07 14:46:54

whocarez
Plugin Author
From: Germany/Ukraine
Registered: 2007-10-08
Posts: 250
Website

Textile for tables on responsive sites

Hi,

I use often tables and to get it mobile friendly I use an extra div to fit longer tables to the screen of smaller devices with a css like this: div.tablediv {overflow-x:auto}

and the code goes like this

<div class="tablediv">

|^.
|_<. header|_<>. header|_<>. header|
|-.
|<. text |<>. some text |<>. more text|
...
</div>

The question is, if there is a textile inherent way to get the same result? Somehow it is actually more like a workaround.

Offline

#2 2019-03-07 16:06:32

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,620
Website

Re: Textile for tables on responsive sites

Can you apply the class directly to the table or does it need to be a wrapper? Otherwise:

table(tablediv).
|^.
|_<. header|_<>. header|_<>. header|
|-.
|<. text |<>. some text |<>. more text|
...

The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2019-03-07 16:11:46

whocarez
Plugin Author
From: Germany/Ukraine
Registered: 2007-10-08
Posts: 250
Website

Re: Textile for tables on responsive sites

It should be a wrapper. So probably, there is no “textile way” to do this.

Offline

#4 2019-03-07 16:35:25

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,620
Website

Re: Textile for tables on responsive sites

Probably not then. Textile doesn’t support div as a block level shortcut since it’s only five/six characters and not really a content formatting construct, more layout. I know there are some anomalies and blurred edges in Textile, but that’s the core concept behind it.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#5 2019-03-07 21:02:03

philwareham
Core designer
From: Farnham, Surrey, UK
Registered: 2009-06-11
Posts: 3,175
Website

Re: Textile for tables on responsive sites

You can use JavaScript to append a container around a table maybe.

Offline

Board footer

Powered by FluxBB