Home > Article > Web Front-end > What is the usage of formatter in bootstrap?
In bootstrap, formatter is a function used to format the data of the current column. The syntax is "formatter(value, row, index)"; the parameters in the syntax respectively represent the values in the current cell. The value of , the current row, and the subscript of the current row.
The operating environment of this tutorial: Windows 10 system, bootstrap version 3.3.7, DELL G3 computer
formatter This attribute belongs to the column parameter, which means to format the data of the current column. It is a function with three parameters, value, row, index,
The syntax is:
formatter(value,row,index)
value: represents the value in the current cell,
row: represents the current row,
index: represents the subscript of the current row,
can be returned using return The data you want is displayed in the cell;
Usage of formatter:
You can directly add function
Two ways to write functions (I like this method)
Related recommendations: bootstrap tutorial
The above is the detailed content of What is the usage of formatter in bootstrap?. For more information, please follow other related articles on the PHP Chinese website!