File: columns.contentPadding.xml

package info (click to toggle)
datatables.js 1.10.21%2Bdfsg-2%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 22,604 kB
  • sloc: javascript: 64,254; xml: 10,441; php: 4,623; sh: 523; makefile: 21
file content (27 lines) | stat: -rw-r--r-- 1,267 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?xml version="1.0" encoding="UTF-8" ?>
<dt-option group="columns">
	<name>columns.contentPadding</name>
	<summary>Add padding to the text content used when calculating the optimal width for a table.</summary>
	<since>1.10</since>

	<type type="string" />

	<description>
		The first thing to say about this property is that generally you shouldn't need this!

		Having said that, it can be useful on rare occasions. When DataTables calculates the column widths to assign to each column, it finds the longest string in each column and then constructs a temporary table and reads the widths from that. The problem with this is that "mmm" is much wider then "iiii", but the latter is a longer string - thus the calculation can go wrong (doing it properly and putting it into an DOM object and measuring that is horribly slow!). Thus as a "work around" we provide this option. It will append its value to the text that is found to be the longest string for the column - i.e. padding.
	</description>

	<example title="Set a content padding for the last column in the table"><![CDATA[
$('#example').dataTable( {
  "columns": [
    null,
    null,
    null,
    { "contentPadding": "mmm" }
  ]
} );
]]></example>

  <related type="option">autoWidth</related>
</dt-option>