Sphinx doesn't respect :widths: attribute for tables (rtd-theme) - python-sphinx

I declare a table for sphinx using this syntax:
.. list-table::
:header-rows: 1
:widths: 1 1 2
* - Platzhalter
- Beispiel
- Beschreibung
* - <from_date>
- <from_date>
- ...
But Sphinx is just ignoring the widths attribute somehow as shown below:
The table clearly doesn't obey my specifications. How can I fix this?
Note: I'm using the read the docs theme and I had to put
.wy-table-responsive table td,
.wy-table-responsive table th {
white-space: normal;
}
into my layout.html to make tables respect the div border. Maybe it has something to do with this. If I leave out this option I just get a scrollbar which is also not nice :/

Related

How to limit calendar entry size in oracle apex

I was wondering if anyone knows if it's possible and how to limit a calendar entry size so it doesn't look like in the example. I don't want to span all the way to the right I want to have a fixed width as the size to the right doesn't define time as the height.
There is no option to limit the width of calendar entry in declarative way but here is an alternate solution. Although, I wouldn't recommend limiting the width as it goes against the responsive design of Oracle APEX Theme UI.
Step 1: Update SQL Query, specifically CSS_COLUMN to have something specific to get handle of the entry. It is better than using predefined classes.
select
1 id,
sysdate start_date,
sysdate + 1 / 24 end_date,
'sample text for calendar entry' task_name,
'event-style apex-cal-green' css_class, -- update class
'Assigned to KD' as supplemental_info
from
dual
Step 2: Enter inline CSS in page property to limit the width of calendar entry. Try to work with different property values of CSS style width if the example below does not help.
.event-style {
width: min-content;
/* width: 100px; */
/* width: 20%; */
}
That's it. Final result should look like the one in the image.

Is there a way to select a random cell from an HTML table and change its background color?

I need to randomly select a single cell from a 5X5 table and change its background color. I would like to do this by choosing a random index location in the table.
I want to do this:
table > tr:nth-child(Random Number between 1 and 5) > td:nth-child(Random number between 1 and 5){
background-color: aqua;
}
I figured it out. Used this:
let selected = document.getElementById("table").rows[Math.floor(Math.random() * 5)].cells[Math.floor(Math.random() * 5)];
selected.id = "selected";
Ideally I would generate the random numbers, one for the and one for the in javascript and then pass the value to the css style sheet.
assign an id to the tds and make an array that contain the ids of these cells choose randomly from the array and change the style color of the cell matching the id
you might need to use javascript
PS if my answer helped you please upvote or choose it as answer if it was what you're looking for

Vuetify-DataTable Change Header Height

I am trying to change the height of the Table header unfortunate an not able to find any way to change table header height.
Could you please help me to reduce the table header height?
I have attached the screen shot.
For everyone who stumbles across this question:
You can change the header height or basically every css attribute of the header via css.
Just add this piece of code to your <style> tag
<style>
>>> .v-data-table-header {
height: 70px;
}
</style>
You can do it only with CSS. Maybe in version 2 it will be done.
Today set style on selector table.v-table thead tr {}
'v-data-table' API option
your variables.scss input variable
v-data-table
$data-table-regular-header-height: 2rem;
v-data-table option dense
// all table height(v-data-table option dense)
$data-table-dense-header-height: 2rem;
only table header height, modify '$data-table-dense-row-height'
// basic value
$data-table-dense-row-height: data-table-dense-header-height !default;
other sass option -> vutify site

Nested / Compounded roles: apply multiple roles to overlapping text

In my custom.css file I have,
.bold {
font-weight: bold;
}
.red {
color:red;
}
And in my _.rst file,
.. role:: bold
.. role:: red
But if I try to nest/compound them, only the outermost role takes effect, e.g.
:bold:`:red:`This is only bold``
This is only bold
Is there a way to combine these effects without defining a new (combined) role?
you can use a custom css class directive:
.. cssclass:: boldred
bold red text
and update the css to format the boldred class
Roles are defined that the can not be nested.
Neither HTML nor LaTeX, as backends, support overlapping of styles.

birt report generic style for all rows in table

I am trying to create a generic style for all rows in my data table. I have been looking around and there seems to be a function I can use named rownum.
I tired to create the style like this...
row["__rownum"] Less than 0
then colour = Red
But this is not right. Can someone tell me the right way to do this so I can apply the style to multiple cells in my table.
Also where can i find documentation on what sort of functions like this are available?
thanks
I know two ways how you can specify conditional styles in BIRT:
You can write an "onRender" eventHandler (either in Java or JavaScript) for your row. In JavaScript it could looks as follow:
if (row["__rownum"] % 2 == 0) {
this.getStyle().backgroundColor = "red";
} else {
this.getStyle().color = "red";
}
Or create a new BIRT style with a highlight-rule like follows:
row["__rownum"] % 2 equals to 0 then
Set Color or whatever or apply another style
Instead of creating a new style, that you will have to assign to target elements, you can also modify one of the predefined styles, if you find a one matching your targets.
Both EventHandler and Styles can be assigned to various element: Cells, Rows, Tables, Report...
Links you may find helpful:
https://www.eclipse.org/birt/phoenix/deploy/reportScripting.php
http://help.eclipse.org/helios/index.jsp?topic=%2Forg.eclipse.birt.doc.isv%2Fmodel%2Fapi%2Forg%2Feclipse%2Fbirt%2Freport%2Fmodel%2Fapi%2FElementFactory.html
BIRT: Alternating row Color in a table group

Resources