Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
framed wide tables
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Davide Cittaro  
View profile  
 More options Oct 30 2012, 12:05 pm
From: Davide Cittaro <daweonl...@gmail.com>
Date: Tue, 30 Oct 2012 09:05:11 -0700 (PDT)
Local: Tues, Oct 30 2012 12:05 pm
Subject: framed wide tables

Hi all, I'm pretty new to Sphinx, it looks great for my documentation
purposes :-)
I'm trying to insert a wide table, meaning that it exceeds the screen width
and, most important, it is written over the sidebar. I wonder if it is
possible to put a table in a frame just like code-blocks are (indeed code
blocks are rendered in a scrollable frame).
Thanks

d


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Axial  
View profile  
 More options Nov 5 2012, 9:05 pm
From: Axial <holger.sp...@gmail.com>
Date: Mon, 5 Nov 2012 18:05:25 -0800 (PST)
Local: Mon, Nov 5 2012 9:05 pm
Subject: Re: framed wide tables

Here is a recipe you can try :

   - Use the .. class:: directive just prior to your table (here I'll call
   it 'scrollwide' - you can use any name you like as long as it conforms to
   CSS/Sphinx rules):

.. class:: *scrollwide*

==================

> =================================================================

col 1              col 2

==================

> =================================================================

entry 1            vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvery long

> entry 2

entry 3            vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvery long entry 4

entry 5            vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvery long

> entry 6

==================

> =================================================================

   - Add an additional stylesheet to your *conf.py* (here 'scrollwide.css'):

def setup(app):

    app.add_stylesheet('*scrollwide*.css')

   - Create the according CSS file in your *_static* directory with the
   following content:

table.*scrollwide* {

    display: block;

    width: 400px;

    background-color: #E0;

    overflow: auto;

}

table.*scrollwide* td {

    white-space: nowrap;

}

You should get a result similar to this:

<https://lh6.googleusercontent.com/-0aUYglKFCzg/UJhtz4C-XdI/AAAAAAAADn...>

See also

   - http://docutils.sourceforge.net/docs/ref/rst/directives.html#class (class
   directive)
   - http://sphinx-doc.org/config.html#confval-html_static_path (static
   path config)

One thing which might trip you up is that the class directive might be
overwritten by domain extensions.
Use *.. rst-class::* instead (see http://sphinx-doc.org/rest.html#id3)

Check your HTML source after the Sphinx build. It should contain
the additional CSS class. My example looks like this:

<table border="1" class="scrollwide docutils">

<colgroup>

<col width="22%" />

<col width="78%" />

</colgroup>

<thead valign="bottom">

<tr class="row-odd"><th class="head">col 1</th>

<th class="head">col 2</th>

</tr>

</thead>

<tbody valign="top">

<tr class="row-even"><td>entry 1</td>

<td>vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvery long entry 2</td>

</tr>

<tr class="row-odd"><td>entry 3</td>

<td>vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvery long entry 4</td>

</tr>

<tr class="row-even"><td>entry 5</td>

<td>vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvery long entry 6</td>

</tr>

</tbody>

</table>

Now you should be able to style your table any way you want. I hope this
helps.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Davide Cittaro  
View profile  
 More options Nov 6 2012, 2:31 am
From: Davide Cittaro <daweonl...@gmail.com>
Date: Tue, 6 Nov 2012 08:31:38 +0100
Local: Tues, Nov 6 2012 2:31 am
Subject: Re: [sphinx-users] Re: framed wide tables
Using rst-class worked! Thanks!!

d
On Nov 6, 2012, at 3:05 AM, Axial <holger.sp...@gmail.com> wrote:

---
Davide Cittaro
daweonl...@gmail.com
http://sites.google.com/site/davidecittaro/

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »