I am using Sphinx to create this table:
+---------------+---------------------+---------------------------+-------------------------------------+---------------------+
| Stakeholder | Major Value | Attitudes | Constraints | Major Interests |
+===============+=====================+===========================+=====================================+=====================+
| Manager | Reduce data entry. | Strong commitment through | Cost, time and the required skill to| Google apps |
| | Improve ft | release 4. | develop this application. | integration. |
| | productivity. | | | |
+---------------+---------------------+---------------------------+-------------------------------------+---------------------+
| Ft | More efficient use | Strong enthusiasm | Training required to use CRM. | Google apps |
| | of time. Less | | | integration. |
| | repetitive work. | | | |
| | | | | |
+---------------+---------------------+---------------------------+-------------------------------------+---------------------+
I want the column width to be fixed at a narrow size so this table can be displayed in one page. But Sphinx makes the ceil text into one long line. So the column width is the size of the ceil text. See the attached image.
Is there a way to fix the column width or make the ceil text displayed as the source table?
Thanks
The width of the columns i.e. td in a table can be fixed very easily. This can be done by adding the width attribute in the <td> tag. If the width is not specified, the width of the column changes according to the change in the content. The specifications of width for the columns can be in pixels, or percentage.
If you want to set the width of the table column, you can use some CSS. You need to use the width property. In the example below, we set the width of the the <table> element to 100%. Then, in the HTML part, we distribute the table width of 100% among <col> elements having span attributes.
Using width attribute: The <td> tag has width attribute to control the width of a particular column. By assigning a numeric value to this attribute between 0 to 100 in terms of percentage(or you can use pixel format). We can restrict the column width up to that much percentage of the table's total width.
To set the width of a column, give one of the <td> cells the desired width. For example <td width=”300″> would set the width of that column to 300px. You can also use a percentage here, in which case <td width=”30%” would set that column's width to 30% of the total table width.
If your issue is with latex output, the tabularcolumns
directive gives you the necessary flexibility.
Here is an example for forcing the width of the first 2 columns:
.. tabularcolumns:: |p{1.5cm}|p{1.5cm}|L|
For more information, see the reference documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With