index.html 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  6. <meta name="description" content="The column options API of Bootstrap Table.">
  7. <meta name="author" content="Zhixin Wen, and Bootstrap Table contributors">
  8. <meta name="generator" content="Jekyll v3.8.7">
  9. <meta name="keywords" content="bootstrap,table,pagination,checkbox,radio,datatables,css,css-framework,semantic,semantic-ui,bulma,material,material-design,materialize,foundation">
  10. <meta name="docsearch:language" content="en">
  11. <title>Column Options · Bootstrap Table</title>
  12. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css"><!-- Documentation extras -->
  13. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css">
  14. <link rel="stylesheet" href="/assets/css/docs.min.css">
  15. <link rel="stylesheet" href="/assets/css/style.css?m=9">
  16. <!-- Favicons -->
  17. <link rel="icon" href="/favicon.png">
  18. <script type="text/javascript">
  19. if (window !== top) // 判断当前的 window 对象是否是 top 对象
  20. top.location.href = window.location.href // 如果不是,将 top 对象的网址自动导向被嵌入网页的网址
  21. </script>
  22. </head>
  23. <body>
  24. <a class="skippy sr-only sr-only-focusable" href="#content">
  25. <span class="skippy-text">Skip to main content</span>
  26. </a>
  27. <header class="navbar navbar-expand navbar-dark flex-column flex-md-row bd-navbar">
  28. <a class="navbar-brand mr-0 mr-md-2" href="/" aria-label="Bootstrap">
  29. <img src="/favicon.png" width="36" height="36">
  30. </a>
  31. <div class="navbar-nav-scroll">
  32. <ul class="navbar-nav bd-navbar-nav flex-row">
  33. <li class="nav-item">
  34. <a class="nav-link "
  35. href="/">Home</a>
  36. </li>
  37. <li class="nav-item">
  38. <a class="nav-link active"
  39. href="/docs/getting-started/introduction/">
  40. Documentation
  41. </a>
  42. </li>
  43. <li class="nav-item ">
  44. <a class="nav-link" href="/themes">
  45. Themes
  46. </a>
  47. </li>
  48. <li class="nav-item">
  49. <a class="nav-link "
  50. href="https://examples.bootstrap-table.com">
  51. Examples
  52. </a>
  53. </li>
  54. <li class="nav-item">
  55. <a class="nav-link"
  56. href="https://live.bootstrap-table.com"
  57. target="_blank">
  58. Online Editor
  59. </a>
  60. </li>
  61. <li class="nav-item ">
  62. <a class="nav-link" href="/news">
  63. News
  64. </a>
  65. </li>
  66. <li class="nav-item">
  67. <a class="nav-link"
  68. href="https://blog.bootstrap-table.com"
  69. target="_blank">
  70. Blog
  71. </a>
  72. </li>
  73. </ul>
  74. </div>
  75. <ul class="navbar-nav flex-row ml-md-auto d-none d-md-flex">
  76. <li class="nav-item dropdown">
  77. <a class="nav-item nav-link dropdown-toggle mr-md-2" href="#" id="bd-versions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  78. v1.23.5
  79. </a>
  80. <div class="dropdown-menu dropdown-menu-md-right" aria-labelledby="bd-versions">
  81. <a class="dropdown-item active" href="/">Latest (1.23.5)</a>
  82. <a class="dropdown-item" href="http://bootstrap-table.com/versions/1.21.4/" target="_blank">v1.21.4</a>
  83. <a class="dropdown-item" href="http://bootstrap-table.com/versions/1.20.2/" target="_blank">v1.20.2</a>
  84. <a class="dropdown-item" href="http://bootstrap-table.com/versions/1.19.1/" target="_blank">v1.19.1</a>
  85. <a class="dropdown-item" href="http://bootstrap-table.com/versions/1.18.3/" target="_blank">v1.18.3</a>
  86. <a class="dropdown-item" href="http://bootstrap-table.com/versions/1.17.1/" target="_blank">v1.17.1</a>
  87. <a class="dropdown-item" href="http://bootstrap-table.com/versions/1.16.0/" target="_blank">v1.16.0</a>
  88. <a class="dropdown-item" href="http://bootstrap-table.com/versions/1.15.5/" target="_blank">v1.15.5</a>
  89. </div>
  90. </li>
  91. <li class="nav-item">
  92. <a class="nav-link p-2" href="https://github.com/wenzhixin/bootstrap-table" target="_blank" rel="noopener" aria-label="GitHub"><svg class="navbar-nav-svg" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 512 499.36" focusable="false" role="img"><path d="M256 0C114.64 0 0 114.61 0 256c0 113.09 73.34 209 175.08 242.9 12.8 2.35 17.47-5.56 17.47-12.34 0-6.08-.22-22.18-.35-43.54-71.2 15.49-86.2-34.34-86.2-34.34-11.64-29.57-28.42-37.45-28.42-37.45-23.27-15.84 1.73-15.55 1.73-15.55 25.69 1.81 39.21 26.38 39.21 26.38 22.84 39.12 59.92 27.82 74.5 21.27 2.33-16.54 8.94-27.82 16.25-34.22-56.84-6.43-116.6-28.43-116.6-126.49 0-27.95 10-50.8 26.35-68.69-2.63-6.48-11.42-32.5 2.51-67.75 0 0 21.49-6.88 70.4 26.24a242.65 242.65 0 0 1 128.18 0c48.87-33.13 70.33-26.24 70.33-26.24 14 35.25 5.18 61.27 2.55 67.75 16.41 17.9 26.31 40.75 26.31 68.69 0 98.35-59.85 120-116.88 126.32 9.19 7.9 17.38 23.53 17.38 47.41 0 34.22-.31 61.83-.31 70.23 0 6.85 4.61 14.81 17.6 12.31C438.72 464.97 512 369.08 512 256.02 512 114.62 397.37 0 256 0z" fill="currentColor" fill-rule="evenodd"/></svg>
  93. </a>
  94. </li>
  95. <li class="nav-item">
  96. <a class="nav-link p-2" href="https://twitter.com/wenzhixin2010" target="_blank" rel="noopener" aria-label="Twitter"><svg class="navbar-nav-svg" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 512 416.32" focusable="false" role="img"><path d="M160.83 416.32c193.2 0 298.92-160.22 298.92-298.92 0-4.51 0-9-.2-13.52A214 214 0 0 0 512 49.38a212.93 212.93 0 0 1-60.44 16.6 105.7 105.7 0 0 0 46.3-58.19 209 209 0 0 1-66.79 25.37 105.09 105.09 0 0 0-181.73 71.91 116.12 116.12 0 0 0 2.66 24c-87.28-4.3-164.73-46.3-216.56-109.82A105.48 105.48 0 0 0 68 159.6a106.27 106.27 0 0 1-47.53-13.11v1.43a105.28 105.28 0 0 0 84.21 103.06 105.67 105.67 0 0 1-47.33 1.84 105.06 105.06 0 0 0 98.14 72.94A210.72 210.72 0 0 1 25 370.84a202.17 202.17 0 0 1-25-1.43 298.85 298.85 0 0 0 160.83 46.92" fill="currentColor"/></svg>
  97. </a>
  98. </li>
  99. <li class="nav-item">
  100. <a class="nav-link p-2" href="https://opencollective.com/bootstrap-table" target="_blank" rel="noopener" aria-label="Open Collective"><svg class="navbar-nav-svg" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 40 41" focusable="false" role="img" fill="currentColor" fill-rule="evenodd"><title>Open Collective</title><path d="M32.8 21c0 2.4-.8 4.9-2 6.9l5.1 5.1c2.5-3.4 4.1-7.6 4.1-12 0-4.6-1.6-8.8-4-12.2L30.7 14c1.2 2 2 4.3 2 7z" fill-opacity=".4"/><path d="M20 33.7a12.8 12.8 0 0 1 0-25.6c2.6 0 5 .7 7 2.1L32 5a20 20 0 1 0 .1 31.9l-5-5.2a13 13 0 0 1-7 2z"/></svg>
  101. </a>
  102. </li>
  103. </ul>
  104. <a class="btn btn-bd-download d-none d-lg-inline-block mb-3 mb-md-0 ml-md-3"
  105. href="/docs/getting-started/download/">Download</a>
  106. </header>
  107. <div class="container-fluid">
  108. <div class="row flex-xl-nowrap">
  109. <div class="col-12 col-md-3 col-xl-2 bd-sidebar">
  110. <form class="bd-search d-flex align-items-center">
  111. <input type="search" class="form-control"
  112. id="search-input" placeholder="Search..."
  113. aria-label="Search for..." autocomplete="off">
  114. <button class="btn btn-link bd-search-docs-toggle d-md-none p-0 ml-3"
  115. type="button" data-toggle="collapse" data-target="#bd-docs-nav"
  116. aria-controls="bd-docs-nav" aria-expanded="false"
  117. aria-label="Toggle docs navigation"><svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 30 30" width="30" height="30" focusable="false" role="img"><title>Menu</title><path stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-miterlimit="10" d="M4 7h22M4 15h22M4 23h22"/></svg>
  118. </button>
  119. </form>
  120. <nav class="collapse bd-links" id="bd-docs-nav"><div class="bd-toc-item">
  121. <a class="bd-toc-link" href="/docs/getting-started/introduction/">
  122. Getting started
  123. </a>
  124. <ul class="nav bd-sidenav"><li>
  125. <a href="/docs/getting-started/introduction/">
  126. Introduction
  127. </a>
  128. </li><li>
  129. <a href="/docs/getting-started/download/">
  130. Download
  131. </a>
  132. </li><li>
  133. <a href="/docs/getting-started/contents/">
  134. Contents
  135. </a>
  136. </li><li>
  137. <a href="/docs/getting-started/usage/">
  138. Usage
  139. </a>
  140. </li><li>
  141. <a href="/docs/getting-started/browsers-devices/">
  142. Browsers & devices
  143. </a>
  144. </li><li>
  145. <a href="/docs/getting-started/build-tools/">
  146. Build tools
  147. </a>
  148. </li></ul>
  149. </div><div class="bd-toc-item active">
  150. <a class="bd-toc-link" href="/docs/api/table-options/">
  151. API
  152. </a>
  153. <ul class="nav bd-sidenav"><li>
  154. <a href="/docs/api/table-options/">
  155. Table Options
  156. </a>
  157. </li><li class="active bd-sidenav-active">
  158. <a href="/docs/api/column-options/">
  159. Column Options
  160. </a>
  161. </li><li>
  162. <a href="/docs/api/events/">
  163. Events
  164. </a>
  165. </li><li>
  166. <a href="/docs/api/methods/">
  167. Methods
  168. </a>
  169. </li><li>
  170. <a href="/docs/api/localizations/">
  171. Localizations
  172. </a>
  173. </li></ul>
  174. </div><div class="bd-toc-item">
  175. <a class="bd-toc-link" href="/docs/extensions/addrbar/">
  176. Extensions
  177. </a>
  178. <ul class="nav bd-sidenav"><li>
  179. <a href="/docs/extensions/addrbar/">
  180. Addrbar
  181. </a>
  182. </li><li>
  183. <a href="/docs/extensions/auto-refresh/">
  184. Auto Refresh
  185. </a>
  186. </li><li>
  187. <a href="/docs/extensions/cookie/">
  188. Cookie
  189. </a>
  190. </li><li>
  191. <a href="/docs/extensions/copy-rows/">
  192. Copy Rows
  193. </a>
  194. </li><li>
  195. <a href="/docs/extensions/custom-view/">
  196. Custom View
  197. </a>
  198. </li><li>
  199. <a href="/docs/extensions/defer-url/">
  200. Defer URL
  201. </a>
  202. </li><li>
  203. <a href="/docs/extensions/editable/">
  204. Editable
  205. </a>
  206. </li><li>
  207. <a href="/docs/extensions/export/">
  208. Export
  209. </a>
  210. </li><li>
  211. <a href="/docs/extensions/filter-control/">
  212. Filter Control
  213. </a>
  214. </li><li>
  215. <a href="/docs/extensions/fixed-columns/">
  216. Fixed Columns
  217. </a>
  218. </li><li>
  219. <a href="/docs/extensions/group-by-v2/">
  220. Group By v2
  221. </a>
  222. </li><li>
  223. <a href="/docs/extensions/i18n-enhance/">
  224. i18n Enhance
  225. </a>
  226. </li><li>
  227. <a href="/docs/extensions/key-events/">
  228. Key Events
  229. </a>
  230. </li><li>
  231. <a href="/docs/extensions/mobile/">
  232. Mobile
  233. </a>
  234. </li><li>
  235. <a href="/docs/extensions/multiple-sort/">
  236. Multiple Sort
  237. </a>
  238. </li><li>
  239. <a href="/docs/extensions/page-jump-to/">
  240. Page Jump To
  241. </a>
  242. </li><li>
  243. <a href="/docs/extensions/pipeline/">
  244. Pipeline
  245. </a>
  246. </li><li>
  247. <a href="/docs/extensions/print/">
  248. Print
  249. </a>
  250. </li><li>
  251. <a href="/docs/extensions/reorder-columns/">
  252. Reorder Columns
  253. </a>
  254. </li><li>
  255. <a href="/docs/extensions/reorder-rows/">
  256. Reorder Rows
  257. </a>
  258. </li><li>
  259. <a href="/docs/extensions/resizable/">
  260. Resizable
  261. </a>
  262. </li><li>
  263. <a href="/docs/extensions/sticky-header/">
  264. Sticky Header
  265. </a>
  266. </li><li>
  267. <a href="/docs/extensions/toolbar/">
  268. Toolbar
  269. </a>
  270. </li><li>
  271. <a href="/docs/extensions/treegrid/">
  272. Treegrid
  273. </a>
  274. </li></ul>
  275. </div><div class="bd-toc-item">
  276. <a class="bd-toc-link" href="/docs/vuejs/introduction/">
  277. VueJS
  278. </a>
  279. <ul class="nav bd-sidenav"><li>
  280. <a href="/docs/vuejs/introduction/">
  281. Introduction
  282. </a>
  283. </li><li>
  284. <a href="/docs/vuejs/browser/">
  285. Browser
  286. </a>
  287. </li><li>
  288. <a href="/docs/vuejs/webpack/">
  289. Webpack
  290. </a>
  291. </li><li>
  292. <a href="/docs/vuejs/component/">
  293. Component
  294. </a>
  295. </li></ul>
  296. </div><div class="bd-toc-item">
  297. <a class="bd-toc-link" href="/docs/online-editor/">
  298. Online Editor
  299. </a>
  300. <ul class="nav bd-sidenav"></ul>
  301. </div><div class="bd-toc-item">
  302. <a class="bd-toc-link" href="/docs/faq/">
  303. FAQ
  304. </a>
  305. <ul class="nav bd-sidenav"></ul>
  306. </div><div class="bd-toc-item">
  307. <a class="bd-toc-link" href="/docs/about/overview/">
  308. About
  309. </a>
  310. <ul class="nav bd-sidenav"><li>
  311. <a href="/docs/about/overview/">
  312. Overview
  313. </a>
  314. </li><li>
  315. <a href="/docs/about/team/">
  316. Team
  317. </a>
  318. </li><li>
  319. <a href="/docs/about/license/">
  320. License
  321. </a>
  322. </li><li>
  323. <a href="/docs/about/translations/">
  324. Translations
  325. </a>
  326. </li></ul>
  327. </div></nav>
  328. </div>
  329. <div class="d-none d-xl-block col-xl-2 bd-toc">
  330. <ul class="section-nav">
  331. <li class="toc-entry toc-h2"><a href="#align">align</a></li>
  332. <li class="toc-entry toc-h2"><a href="#cardvisible">cardVisible</a></li>
  333. <li class="toc-entry toc-h2"><a href="#cellstyle">cellStyle</a></li>
  334. <li class="toc-entry toc-h2"><a href="#checkbox">checkbox</a></li>
  335. <li class="toc-entry toc-h2"><a href="#checkboxenabled">checkboxEnabled</a></li>
  336. <li class="toc-entry toc-h2"><a href="#class">class</a></li>
  337. <li class="toc-entry toc-h2"><a href="#clicktoselect">clickToSelect</a></li>
  338. <li class="toc-entry toc-h2"><a href="#colspan">colspan</a></li>
  339. <li class="toc-entry toc-h2"><a href="#detailformatter">detailFormatter</a></li>
  340. <li class="toc-entry toc-h2"><a href="#escape">escape</a></li>
  341. <li class="toc-entry toc-h2"><a href="#events">events</a></li>
  342. <li class="toc-entry toc-h2"><a href="#falign">falign</a></li>
  343. <li class="toc-entry toc-h2"><a href="#field">field</a></li>
  344. <li class="toc-entry toc-h2"><a href="#footerformatter">footerFormatter</a></li>
  345. <li class="toc-entry toc-h2"><a href="#footerstyle">footerStyle</a></li>
  346. <li class="toc-entry toc-h2"><a href="#formatter">formatter</a></li>
  347. <li class="toc-entry toc-h2"><a href="#halign">halign</a></li>
  348. <li class="toc-entry toc-h2"><a href="#order">order</a></li>
  349. <li class="toc-entry toc-h2"><a href="#radio">radio</a></li>
  350. <li class="toc-entry toc-h2"><a href="#rowspan">rowspan</a></li>
  351. <li class="toc-entry toc-h2"><a href="#searchable">searchable</a></li>
  352. <li class="toc-entry toc-h2"><a href="#searchformatter">searchFormatter</a></li>
  353. <li class="toc-entry toc-h2"><a href="#searchhighlightformatter">searchHighlightFormatter</a></li>
  354. <li class="toc-entry toc-h2"><a href="#showselecttitle">showSelectTitle</a></li>
  355. <li class="toc-entry toc-h2"><a href="#sortable">sortable</a></li>
  356. <li class="toc-entry toc-h2"><a href="#sorter">sorter</a></li>
  357. <li class="toc-entry toc-h2"><a href="#sortname">sortName</a></li>
  358. <li class="toc-entry toc-h2"><a href="#switchable">switchable</a></li>
  359. <li class="toc-entry toc-h2"><a href="#switchablelabel">switchableLabel</a></li>
  360. <li class="toc-entry toc-h2"><a href="#title">title</a></li>
  361. <li class="toc-entry toc-h2"><a href="#titletooltip">titleTooltip</a></li>
  362. <li class="toc-entry toc-h2"><a href="#valign">valign</a></li>
  363. <li class="toc-entry toc-h2"><a href="#visible">visible</a></li>
  364. <li class="toc-entry toc-h2"><a href="#width">width</a></li>
  365. <li class="toc-entry toc-h2"><a href="#widthunit">widthUnit</a></li>
  366. </ul>
  367. </div>
  368. <main class="col-12 col-md-9 col-xl-8 py-md-3 pl-md-5 bd-content api" role="main">
  369. <div class="d-md-flex flex-md-row-reverse align-items-center justify-content-between">
  370. <a class="btn btn-sm btn-bd-light mb-2 mb-md-0"
  371. href="https://github.com/wenzhixin/bootstrap-table/blob/develop/site/docs/api/column-options.md"
  372. title="View and edit this file on GitHub" target="_blank" rel="noopener">
  373. View on GitHub
  374. </a>
  375. <h1 class="bd-title" id="content">
  376. Column Options
  377. </h1>
  378. </div>
  379. <p class="bd-lead">The column options API of Bootstrap Table.</p>
  380. <div id="gg"></div>
  381. <p>The column options is defined in <code class="highlighter-rouge">jQuery.fn.bootstrapTable.columnDefaults</code>.</p>
  382. <h2 id="align">align</h2>
  383. <ul>
  384. <li>
  385. <p><strong>Attribute:</strong> <code class="highlighter-rouge">data-align</code></p>
  386. </li>
  387. <li>
  388. <p><strong>Type:</strong> <code class="highlighter-rouge">String</code></p>
  389. </li>
  390. <li>
  391. <p><strong>Detail:</strong></p>
  392. <p>Indicate how to align the column data. <code class="highlighter-rouge">'left'</code>, <code class="highlighter-rouge">'right'</code>, <code class="highlighter-rouge">'center'</code> can be used.</p>
  393. </li>
  394. <li>
  395. <p><strong>Default:</strong> <code class="highlighter-rouge">undefined</code></p>
  396. </li>
  397. <li>
  398. <p><strong>Example:</strong> <a href="https://examples.bootstrap-table.com/#column-options/aligning-columns.html">Aligning Columns</a></p>
  399. </li>
  400. </ul>
  401. <h2 id="cardvisible">cardVisible</h2>
  402. <ul>
  403. <li>
  404. <p><strong>Attribute:</strong> <code class="highlighter-rouge">data-card-visible</code></p>
  405. </li>
  406. <li>
  407. <p><strong>Type:</strong> <code class="highlighter-rouge">Boolean</code></p>
  408. </li>
  409. <li>
  410. <p><strong>Detail:</strong></p>
  411. <p>Set <code class="highlighter-rouge">false</code> to hide the columns item in the card view state.</p>
  412. </li>
  413. <li>
  414. <p><strong>Default:</strong> <code class="highlighter-rouge">true</code></p>
  415. </li>
  416. <li>
  417. <p><strong>Example:</strong> <a href="https://examples.bootstrap-table.com/#column-options/card-visible.html">Card Visible</a></p>
  418. </li>
  419. </ul>
  420. <h2 id="cellstyle">cellStyle</h2>
  421. <ul>
  422. <li>
  423. <p><strong>Attribute:</strong> <code class="highlighter-rouge">data-cell-style</code></p>
  424. </li>
  425. <li>
  426. <p><strong>Type:</strong> <code class="highlighter-rouge">Function</code></p>
  427. </li>
  428. <li>
  429. <p><strong>Detail:</strong></p>
  430. <p>The cell style formatter function, take four parameters:</p>
  431. <ul>
  432. <li><code class="highlighter-rouge">value</code>: the field value.</li>
  433. <li><code class="highlighter-rouge">row</code>: the row record data.</li>
  434. <li><code class="highlighter-rouge">index</code>: the row index.</li>
  435. <li><code class="highlighter-rouge">field</code>: the row field.</li>
  436. </ul>
  437. <p>Support classes or css.</p>
  438. </li>
  439. <li>
  440. <p><strong>Default:</strong> <code class="highlighter-rouge">undefined</code></p>
  441. </li>
  442. <li>
  443. <p><strong>Example:</strong> <a href="https://examples.bootstrap-table.com/#column-options/cell-style.html">Cell Style</a></p>
  444. </li>
  445. </ul>
  446. <h2 id="checkbox">checkbox</h2>
  447. <ul>
  448. <li>
  449. <p><strong>Attribute:</strong> <code class="highlighter-rouge">data-checkbox</code></p>
  450. </li>
  451. <li>
  452. <p><strong>Type:</strong> <code class="highlighter-rouge">Boolean</code></p>
  453. </li>
  454. <li>
  455. <p><strong>Detail:</strong></p>
  456. <p>Set <code class="highlighter-rouge">true</code> to show a checkbox. The checkbox column has a fixed width.</p>
  457. <p>If a value is given, the checkbox is automatically checked.
  458. Its also possible to check/uncheck the checkbox by using a formatter (return <code class="highlighter-rouge">true</code> to check, return <code class="highlighter-rouge">false</code> to uncheck).</p>
  459. </li>
  460. <li>
  461. <p><strong>Default:</strong> <code class="highlighter-rouge">false</code></p>
  462. </li>
  463. <li>
  464. <p><strong>Example:</strong> <a href="https://examples.bootstrap-table.com/#column-options/checkbox.html">Column Checkbox</a></p>
  465. </li>
  466. </ul>
  467. <h2 id="checkboxenabled">checkboxEnabled</h2>
  468. <ul>
  469. <li>
  470. <p><strong>Attribute:</strong> <code class="highlighter-rouge">data-checkbox-enabled</code></p>
  471. </li>
  472. <li>
  473. <p><strong>Type:</strong> <code class="highlighter-rouge">Boolean</code></p>
  474. </li>
  475. <li>
  476. <p><strong>Detail:</strong></p>
  477. <p>Set <code class="highlighter-rouge">false</code> to disable the checkboxes/radio boxes.</p>
  478. </li>
  479. <li>
  480. <p><strong>Default:</strong> <code class="highlighter-rouge">true</code></p>
  481. </li>
  482. <li>
  483. <p><strong>Example:</strong> <a href="https://examples.bootstrap-table.com/#column-options/checkbox-enabled.html">Checkbox Enabled</a> and <a href="https://examples.bootstrap-table.com/#column-options/checkbox-disabled.html">Checkbox Disabled</a></p>
  484. </li>
  485. </ul>
  486. <h2 id="class">class</h2>
  487. <ul>
  488. <li>
  489. <p><strong>Attribute:</strong> <code class="highlighter-rouge">class | data-class</code></p>
  490. </li>
  491. <li>
  492. <p><strong>Type:</strong> <code class="highlighter-rouge">String</code></p>
  493. </li>
  494. <li>
  495. <p><strong>Detail:</strong></p>
  496. <p>The column class name.</p>
  497. </li>
  498. <li>
  499. <p><strong>Default:</strong> <code class="highlighter-rouge">undefined</code></p>
  500. </li>
  501. <li>
  502. <p><strong>Example:</strong> <a href="https://examples.bootstrap-table.com/#column-options/class.html">Column Class</a></p>
  503. </li>
  504. </ul>
  505. <h2 id="clicktoselect">clickToSelect</h2>
  506. <ul>
  507. <li>
  508. <p><strong>Attribute:</strong> <code class="highlighter-rouge">data-click-to-select</code></p>
  509. </li>
  510. <li>
  511. <p><strong>Type:</strong> <code class="highlighter-rouge">Boolean</code></p>
  512. </li>
  513. <li>
  514. <p><strong>Detail:</strong></p>
  515. <p>Set <code class="highlighter-rouge">true</code> to select the checkbox or radio box when clicking rows.</p>
  516. </li>
  517. <li>
  518. <p><strong>Default:</strong> <code class="highlighter-rouge">true</code></p>
  519. </li>
  520. <li>
  521. <p><strong>Example:</strong> <a href="https://examples.bootstrap-table.com/#column-options/click-to-select.html">Click to Select</a></p>
  522. </li>
  523. </ul>
  524. <h2 id="colspan">colspan</h2>
  525. <ul>
  526. <li>
  527. <p><strong>Attribute:</strong> <code class="highlighter-rouge">colspan | data-colspan</code></p>
  528. </li>
  529. <li>
  530. <p><strong>Type:</strong> <code class="highlighter-rouge">Number</code></p>
  531. </li>
  532. <li>
  533. <p><strong>Detail:</strong></p>
  534. <p>Indicate how many columns a cell should take up.</p>
  535. </li>
  536. <li>
  537. <p><strong>Default:</strong> <code class="highlighter-rouge">undefined</code></p>
  538. </li>
  539. <li>
  540. <p><strong>Example:</strong> <a href="https://examples.bootstrap-table.com/#column-options/rowspan-colspan.html">Rowspan Colspan</a></p>
  541. </li>
  542. </ul>
  543. <h2 id="detailformatter">detailFormatter</h2>
  544. <ul>
  545. <li>
  546. <p><strong>Attribute:</strong> <code class="highlighter-rouge">data-detail-formatter</code></p>
  547. </li>
  548. <li>
  549. <p><strong>Type:</strong> <code class="highlighter-rouge">Function</code></p>
  550. </li>
  551. <li>
  552. <p><strong>Detail:</strong></p>
  553. <p>Format your detail view when <code class="highlighter-rouge">detailView</code> and <code class="highlighter-rouge">detailViewByClick</code> is set to <code class="highlighter-rouge">true</code>. Return a <code class="highlighter-rouge">String</code> and it will be appended into the detail view cell, optionally render the element directly using the third parameter, which is a jQuery element of the target cell.</p>
  554. <p>Fallback is the detail-formatter of the table.</p>
  555. </li>
  556. <li>
  557. <p><strong>Default:</strong> <code class="highlighter-rouge">function(index, row, $element) { return '' }</code></p>
  558. </li>
  559. <li>
  560. <p><strong>Example:</strong> <a href="https://examples.bootstrap-table.com/#column-options/detail-formatter.html">Detail Formatter</a></p>
  561. </li>
  562. </ul>
  563. <h2 id="escape">escape</h2>
  564. <ul>
  565. <li>
  566. <p><strong>Attribute:</strong> <code class="highlighter-rouge">data-escape</code></p>
  567. </li>
  568. <li>
  569. <p><strong>Type:</strong> <code class="highlighter-rouge">Boolean</code></p>
  570. </li>
  571. <li>
  572. <p><strong>Detail:</strong></p>
  573. <p>Escapes a string for insertion into HTML, replacing &amp;, &lt;, &gt;, “, `, and ‘ characters.</p>
  574. </li>
  575. <li>
  576. <p><strong>Default:</strong> <code class="highlighter-rouge">undefined</code></p>
  577. </li>
  578. <li>
  579. <p><strong>Example:</strong> <a href="https://examples.bootstrap-table.com/#column-options/escape.html">Column Escape</a></p>
  580. </li>
  581. </ul>
  582. <h2 id="events">events</h2>
  583. <ul>
  584. <li>
  585. <p><strong>Attribute:</strong> <code class="highlighter-rouge">data-events</code></p>
  586. </li>
  587. <li>
  588. <p><strong>Type:</strong> <code class="highlighter-rouge">Object</code></p>
  589. </li>
  590. <li>
  591. <p><strong>Detail:</strong></p>
  592. <p>The cell events listener, when you use formatter function, take four parameters:</p>
  593. <ul>
  594. <li><code class="highlighter-rouge">event</code>: the jQuery event.</li>
  595. <li><code class="highlighter-rouge">value</code>: the field value.</li>
  596. <li><code class="highlighter-rouge">row</code>: the row record data.</li>
  597. <li><code class="highlighter-rouge">index</code>: the row index.</li>
  598. </ul>
  599. <p>Example code:</p>
  600. </li>
  601. </ul>
  602. <figure class="highlight"><pre><code class="language-html" data-lang="html"> <span class="nt">&lt;th</span> <span class="err">..</span> <span class="na">data-events=</span><span class="s">"operateEvent"</span><span class="nt">&gt;</span>
  603. var operateEvents = {
  604. 'click .like': function (e, value, row, index) {}
  605. }
  606. </code></pre></figure>
  607. <ul>
  608. <li>
  609. <p><strong>Default:</strong> <code class="highlighter-rouge">undefined</code></p>
  610. </li>
  611. <li><strong>Example:</strong> <a href="https://examples.bootstrap-table.com/#column-options/events.html">Column Events</a>
  612. <h2 id="falign">falign</h2>
  613. </li>
  614. <li>
  615. <p><strong>Attribute:</strong> <code class="highlighter-rouge">data-falign</code></p>
  616. </li>
  617. <li>
  618. <p><strong>Type:</strong> <code class="highlighter-rouge">String</code></p>
  619. </li>
  620. <li>
  621. <p><strong>Detail:</strong></p>
  622. <p>Indicate how to align the table footer. <code class="highlighter-rouge">'left'</code>, <code class="highlighter-rouge">'right'</code>, <code class="highlighter-rouge">'center'</code> can be used.</p>
  623. </li>
  624. <li>
  625. <p><strong>Default:</strong> <code class="highlighter-rouge">undefined</code></p>
  626. </li>
  627. <li><strong>Example:</strong> <a href="https://examples.bootstrap-table.com/#column-options/aligning-footer.html">Aligning Footer</a></li>
  628. </ul>
  629. <h2 id="field">field</h2>
  630. <ul>
  631. <li>
  632. <p><strong>Attribute:</strong> <code class="highlighter-rouge">data-field</code></p>
  633. </li>
  634. <li>
  635. <p><strong>Type:</strong> <code class="highlighter-rouge">String</code></p>
  636. </li>
  637. <li>
  638. <p><strong>Detail:</strong></p>
  639. <p>The column field name. This field must be unique, or some unknown problems may occur.</p>
  640. </li>
  641. <li>
  642. <p><strong>Default:</strong> <code class="highlighter-rouge">undefined</code></p>
  643. </li>
  644. <li>
  645. <p><strong>Example:</strong> <a href="https://examples.bootstrap-table.com/#column-options/field.html">Column Field</a></p>
  646. </li>
  647. </ul>
  648. <h2 id="footerformatter">footerFormatter</h2>
  649. <ul>
  650. <li>
  651. <p><strong>Attribute:</strong> <code class="highlighter-rouge">data-footer-formatter</code></p>
  652. </li>
  653. <li>
  654. <p><strong>Type:</strong> <code class="highlighter-rouge">Function</code></p>
  655. </li>
  656. <li>
  657. <p><strong>Detail:</strong></p>
  658. <p>The context (this) is the column Object.</p>
  659. <p>The function, takes two parameters:</p>
  660. <ul>
  661. <li><code class="highlighter-rouge">data</code>: Array of all the data rows.</li>
  662. <li><code class="highlighter-rouge">value</code>: If footer data is set, the value of the footer column.</li>
  663. </ul>
  664. <p>The expected return data type is <code class="highlighter-rouge">jQuery</code>, <code class="highlighter-rouge">String</code> or <code class="highlighter-rouge">HTMLElement</code>. Other types will be forced to the <code class="highlighter-rouge">String</code> type.</p>
  665. <p>If you fetch data from a server and set the footer value from the server response, please use the <code class="highlighter-rouge">footerField</code> Option.</p>
  666. </li>
  667. <li>
  668. <p><strong>Default:</strong> <code class="highlighter-rouge">undefined</code></p>
  669. </li>
  670. <li>
  671. <p><strong>Example:</strong> <a href="https://examples.bootstrap-table.com/#column-options/footer-formatter.html">Footer Formatter</a></p>
  672. </li>
  673. </ul>
  674. <h2 id="footerstyle">footerStyle</h2>
  675. <ul>
  676. <li>
  677. <p><strong>Attribute:</strong> <code class="highlighter-rouge">data-footer-style</code></p>
  678. </li>
  679. <li>
  680. <p><strong>Type:</strong> <code class="highlighter-rouge">Function</code></p>
  681. </li>
  682. <li>
  683. <p><strong>Detail:</strong></p>
  684. <p>The footer style formatter function, takes one parameter:</p>
  685. <ul>
  686. <li><code class="highlighter-rouge">column</code>: the column object.</li>
  687. </ul>
  688. <p>Support <code class="highlighter-rouge">classes</code> or <code class="highlighter-rouge">css</code>. Example usage:</p>
  689. </li>
  690. </ul>
  691. <figure class="highlight"><pre><code class="language-javascript" data-lang="javascript"> <span class="kd">function</span> <span class="nx">footerStyle</span><span class="p">(</span><span class="nx">column</span><span class="p">)</span> <span class="p">{</span>
  692. <span class="k">return</span> <span class="p">{</span>
  693. <span class="na">css</span><span class="p">:</span> <span class="p">{</span> <span class="dl">'</span><span class="s1">font-weight</span><span class="dl">'</span><span class="p">:</span> <span class="dl">'</span><span class="s1">normal</span><span class="dl">'</span> <span class="p">},</span>
  694. <span class="na">classes</span><span class="p">:</span> <span class="dl">'</span><span class="s1">my-class</span><span class="dl">'</span>
  695. <span class="p">}</span>
  696. <span class="p">}</span>
  697. </code></pre></figure>
  698. <ul>
  699. <li>
  700. <p><strong>Default:</strong> <code class="highlighter-rouge">{}</code></p>
  701. </li>
  702. <li>
  703. <p><strong>Example:</strong> <a href="https://examples.bootstrap-table.com/#options/footer-style.html">Footer Style</a></p>
  704. </li>
  705. </ul>
  706. <h2 id="formatter">formatter</h2>
  707. <ul>
  708. <li>
  709. <p><strong>Attribute:</strong> <code class="highlighter-rouge">data-formatter</code></p>
  710. </li>
  711. <li>
  712. <p><strong>Type:</strong> <code class="highlighter-rouge">Function</code></p>
  713. </li>
  714. <li>
  715. <p><strong>Detail:</strong></p>
  716. <p>The context (this) is the column Object.</p>
  717. <p>The cell formatter function, take four parameters:</p>
  718. <ul>
  719. <li><code class="highlighter-rouge">value</code>: the field value.</li>
  720. <li><code class="highlighter-rouge">row</code>: the row record data.</li>
  721. <li><code class="highlighter-rouge">index</code>: the row index.</li>
  722. <li><code class="highlighter-rouge">field</code>: the row field.</li>
  723. </ul>
  724. <p>The expected return data type is <code class="highlighter-rouge">jQuery</code>, <code class="highlighter-rouge">String</code> or <code class="highlighter-rouge">HTMLElement</code>. Other types will be forced to the <code class="highlighter-rouge">String</code> type.</p>
  725. </li>
  726. <li>
  727. <p><strong>Default:</strong> <code class="highlighter-rouge">undefined</code></p>
  728. </li>
  729. <li>
  730. <p><strong>Example:</strong> <a href="https://examples.bootstrap-table.com/#column-options/formatter.html">Column Formatter</a></p>
  731. </li>
  732. </ul>
  733. <h2 id="halign">halign</h2>
  734. <ul>
  735. <li>
  736. <p><strong>Attribute:</strong> <code class="highlighter-rouge">data-halign</code></p>
  737. </li>
  738. <li>
  739. <p><strong>Type:</strong> <code class="highlighter-rouge">String</code></p>
  740. </li>
  741. <li>
  742. <p><strong>Detail:</strong></p>
  743. <p>Indicate how to align the table header. <code class="highlighter-rouge">'left'</code>, <code class="highlighter-rouge">'right'</code>, <code class="highlighter-rouge">'center'</code> can be used.</p>
  744. </li>
  745. <li>
  746. <p><strong>Default:</strong> <code class="highlighter-rouge">undefined</code></p>
  747. </li>
  748. <li>
  749. <p><strong>Example:</strong> <a href="https://examples.bootstrap-table.com/#column-options/aligning-columns.html">Aligning Columns</a></p>
  750. </li>
  751. </ul>
  752. <h2 id="order">order</h2>
  753. <ul>
  754. <li>
  755. <p><strong>Attribute:</strong> <code class="highlighter-rouge">data-order</code></p>
  756. </li>
  757. <li>
  758. <p><strong>Type:</strong> <code class="highlighter-rouge">String</code></p>
  759. </li>
  760. <li>
  761. <p><strong>Detail:</strong></p>
  762. <p>The default sort order, can only be <code class="highlighter-rouge">'asc'</code> or <code class="highlighter-rouge">'desc'</code>.</p>
  763. </li>
  764. <li>
  765. <p><strong>Default:</strong> <code class="highlighter-rouge">'asc'</code></p>
  766. </li>
  767. <li>
  768. <p><strong>Example:</strong> <a href="https://examples.bootstrap-table.com/#column-options/sort-name-order.html">Sort Name Order</a></p>
  769. </li>
  770. </ul>
  771. <h2 id="radio">radio</h2>
  772. <ul>
  773. <li>
  774. <p><strong>Attribute:</strong> <code class="highlighter-rouge">data-radio</code></p>
  775. </li>
  776. <li>
  777. <p><strong>Type:</strong> <code class="highlighter-rouge">Boolean</code></p>
  778. </li>
  779. <li>
  780. <p><strong>Detail:</strong></p>
  781. <p>Set <code class="highlighter-rouge">true</code> to show a radio. The radio column has a fixed width.</p>
  782. <p>If a value is given, the checkbox is automatically checked.
  783. Its also possible to check/uncheck the radio by using a formatter (return <code class="highlighter-rouge">true</code> to check, return <code class="highlighter-rouge">false</code> to uncheck).</p>
  784. </li>
  785. <li>
  786. <p><strong>Default:</strong> <code class="highlighter-rouge">false</code></p>
  787. </li>
  788. <li>
  789. <p><strong>Example:</strong> <a href="https://examples.bootstrap-table.com/#column-options/radio.html">Column Radio</a></p>
  790. </li>
  791. </ul>
  792. <h2 id="rowspan">rowspan</h2>
  793. <ul>
  794. <li>
  795. <p><strong>Attribute:</strong> <code class="highlighter-rouge">rowspan | data-rowspan</code></p>
  796. </li>
  797. <li>
  798. <p><strong>Type:</strong> <code class="highlighter-rouge">Number</code></p>
  799. </li>
  800. <li>
  801. <p><strong>Detail:</strong></p>
  802. <p>Indicate how many rows a cell should take up.</p>
  803. </li>
  804. <li>
  805. <p><strong>Default:</strong> <code class="highlighter-rouge">undefined</code></p>
  806. </li>
  807. <li>
  808. <p><strong>Example:</strong> <a href="https://examples.bootstrap-table.com/#column-options/rowspan-colspan.html">Rowspan Colspan</a></p>
  809. </li>
  810. </ul>
  811. <h2 id="searchable">searchable</h2>
  812. <ul>
  813. <li>
  814. <p><strong>Attribute:</strong> <code class="highlighter-rouge">data-searchable</code></p>
  815. </li>
  816. <li>
  817. <p><strong>Type:</strong> <code class="highlighter-rouge">Boolean</code></p>
  818. </li>
  819. <li>
  820. <p><strong>Detail:</strong></p>
  821. <p>Set <code class="highlighter-rouge">true</code> to search data for this column.</p>
  822. </li>
  823. <li>
  824. <p><strong>Default:</strong> <code class="highlighter-rouge">true</code></p>
  825. </li>
  826. <li>
  827. <p><strong>Example:</strong> <a href="https://examples.bootstrap-table.com/#column-options/searchable.html">Column Searchable</a></p>
  828. </li>
  829. </ul>
  830. <h2 id="searchformatter">searchFormatter</h2>
  831. <ul>
  832. <li>
  833. <p><strong>Attribute:</strong> <code class="highlighter-rouge">data-search-formatter</code></p>
  834. </li>
  835. <li>
  836. <p><strong>Type:</strong> <code class="highlighter-rouge">Boolean</code></p>
  837. </li>
  838. <li>
  839. <p><strong>Detail:</strong></p>
  840. <p>Set <code class="highlighter-rouge">true</code> to search using formatted data.</p>
  841. </li>
  842. <li>
  843. <p><strong>Default:</strong> <code class="highlighter-rouge">true</code></p>
  844. </li>
  845. <li>
  846. <p><strong>Example:</strong> <a href="https://examples.bootstrap-table.com/#column-options/search-formatter.html">Search Formatter</a></p>
  847. </li>
  848. </ul>
  849. <h2 id="searchhighlightformatter">searchHighlightFormatter</h2>
  850. <ul>
  851. <li>
  852. <p><strong>Attribute:</strong> <code class="highlighter-rouge">data-search-highlight-formatter</code></p>
  853. </li>
  854. <li>
  855. <p><strong>Type:</strong> <code class="highlighter-rouge">Boolean|Function</code></p>
  856. </li>
  857. <li>
  858. <p><strong>Detail:</strong></p>
  859. <p>Define a <code class="highlighter-rouge">function</code> to use a custom highlight formatter for the <a href="https://bootstrap-table.com/docs/api/table-options/#searchhighlight">search highlight</a> option.</p>
  860. </li>
  861. <li>
  862. <p><strong>Default:</strong> <code class="highlighter-rouge">true</code></p>
  863. </li>
  864. <li>
  865. <p><strong>Example:</strong> <a href="https://examples.bootstrap-table.com/#column-options/search-highlight-formatter.html">Searchable Highlight Formatter</a></p>
  866. </li>
  867. </ul>
  868. <h2 id="showselecttitle">showSelectTitle</h2>
  869. <ul>
  870. <li>
  871. <p><strong>Attribute:</strong> <code class="highlighter-rouge">data-show-select-title</code></p>
  872. </li>
  873. <li>
  874. <p><strong>Type:</strong> <code class="highlighter-rouge">Boolean</code></p>
  875. </li>
  876. <li>
  877. <p><strong>Detail:</strong></p>
  878. <p>Set <code class="highlighter-rouge">true</code> to show the title of column with ‘radio’ or ‘singleSelect’ ‘checkbox’ option.</p>
  879. </li>
  880. <li>
  881. <p><strong>Default:</strong> <code class="highlighter-rouge">false</code></p>
  882. </li>
  883. <li>
  884. <p><strong>Example:</strong> <a href="https://examples.bootstrap-table.com/#column-options/show-select-title.html">Show Select Title</a></p>
  885. </li>
  886. </ul>
  887. <h2 id="sortable">sortable</h2>
  888. <ul>
  889. <li>
  890. <p><strong>Attribute:</strong> <code class="highlighter-rouge">data-sortable</code></p>
  891. </li>
  892. <li>
  893. <p><strong>Type:</strong> <code class="highlighter-rouge">Boolean</code></p>
  894. </li>
  895. <li>
  896. <p><strong>Detail:</strong></p>
  897. <p>Set <code class="highlighter-rouge">true</code> to allow the column can be sorted.</p>
  898. </li>
  899. <li>
  900. <p><strong>Default:</strong> <code class="highlighter-rouge">false</code></p>
  901. </li>
  902. <li>
  903. <p><strong>Example:</strong> <a href="https://examples.bootstrap-table.com/#column-options/sortable.html">Column Sortable</a></p>
  904. </li>
  905. </ul>
  906. <h2 id="sorter">sorter</h2>
  907. <ul>
  908. <li>
  909. <p><strong>Attribute:</strong> <code class="highlighter-rouge">data-sorter</code></p>
  910. </li>
  911. <li>
  912. <p><strong>Type:</strong> <code class="highlighter-rouge">Function</code></p>
  913. </li>
  914. <li>
  915. <p><strong>Detail:</strong></p>
  916. <p>The custom field sort function that is used to do local sorting, take four parameters:</p>
  917. <ul>
  918. <li><code class="highlighter-rouge">fieldA</code>: the first field value.</li>
  919. <li><code class="highlighter-rouge">fieldB</code>: the second field value.</li>
  920. <li><code class="highlighter-rouge">rowA</code>: the first row.</li>
  921. <li><code class="highlighter-rouge">rowB</code>: the second row.</li>
  922. </ul>
  923. <p>Expected return values: <code class="highlighter-rouge">-1, 0, 1</code>.</p>
  924. </li>
  925. <li>
  926. <p><strong>Default:</strong> <code class="highlighter-rouge">undefined</code></p>
  927. </li>
  928. <li>
  929. <p><strong>Example:</strong> <a href="https://examples.bootstrap-table.com/#column-options/sorter.html">Column Sorter</a></p>
  930. </li>
  931. </ul>
  932. <h2 id="sortname">sortName</h2>
  933. <ul>
  934. <li>
  935. <p><strong>Attribute:</strong> <code class="highlighter-rouge">data-sort-name</code></p>
  936. </li>
  937. <li>
  938. <p><strong>Type:</strong> <code class="highlighter-rouge">String</code></p>
  939. </li>
  940. <li>
  941. <p><strong>Detail:</strong></p>
  942. <p>Provide a customizable sort-name, not the default sort-name in the header, or the field name of the column. For example, a column might display the value of fieldName of ‘html’ such as <code class="highlighter-rouge">&lt;b&gt;&lt;span style="color:red"&gt;abc&lt;/span&gt;&lt;/b&gt;</code>, but a fieldName to sort is ‘content’ with the value of <code class="highlighter-rouge">'abc'</code>.</p>
  943. </li>
  944. <li>
  945. <p><strong>Default:</strong> <code class="highlighter-rouge">undefined</code></p>
  946. </li>
  947. <li>
  948. <p><strong>Example:</strong> <a href="https://examples.bootstrap-table.com/#column-options/sort-name-order.html">Sort Name Order</a></p>
  949. </li>
  950. </ul>
  951. <h2 id="switchable">switchable</h2>
  952. <ul>
  953. <li>
  954. <p><strong>Attribute:</strong> <code class="highlighter-rouge">data-switchable</code></p>
  955. </li>
  956. <li>
  957. <p><strong>Type:</strong> <code class="highlighter-rouge">Boolean</code></p>
  958. </li>
  959. <li>
  960. <p><strong>Detail:</strong></p>
  961. <p>Set <code class="highlighter-rouge">false</code> to disable the switchable of columns item.</p>
  962. </li>
  963. <li>
  964. <p><strong>Default:</strong> <code class="highlighter-rouge">true</code></p>
  965. </li>
  966. <li>
  967. <p><strong>Example:</strong> <a href="https://examples.bootstrap-table.com/#column-options/switchable.html">Column Switchable</a></p>
  968. </li>
  969. </ul>
  970. <h2 id="switchablelabel">switchableLabel</h2>
  971. <ul>
  972. <li>
  973. <p><strong>Attribute:</strong> <code class="highlighter-rouge">data-switchable-label</code></p>
  974. </li>
  975. <li>
  976. <p><strong>Type:</strong> <code class="highlighter-rouge">String</code></p>
  977. </li>
  978. <li>
  979. <p><strong>Detail:</strong></p>
  980. <p>The label of the switchable column in the dropdown. If not specified uses the column title.</p>
  981. </li>
  982. <li>
  983. <p><strong>Default:</strong> <code class="highlighter-rouge">undefined</code></p>
  984. </li>
  985. <li>
  986. <p><strong>Example:</strong> <a href="https://examples.bootstrap-table.com/#column-options/switchable.html">Column Switchable</a></p>
  987. </li>
  988. </ul>
  989. <h2 id="title">title</h2>
  990. <ul>
  991. <li>
  992. <p><strong>Attribute:</strong> <code class="highlighter-rouge">data-title</code></p>
  993. </li>
  994. <li>
  995. <p><strong>Type:</strong> <code class="highlighter-rouge">String</code></p>
  996. </li>
  997. <li>
  998. <p><strong>Detail:</strong></p>
  999. <p>The column title text.</p>
  1000. </li>
  1001. <li>
  1002. <p><strong>Default:</strong> <code class="highlighter-rouge">undefined</code></p>
  1003. </li>
  1004. <li>
  1005. <p><strong>Example:</strong> <a href="https://examples.bootstrap-table.com/#column-options/title.html">Column Title</a></p>
  1006. </li>
  1007. </ul>
  1008. <h2 id="titletooltip">titleTooltip</h2>
  1009. <ul>
  1010. <li>
  1011. <p><strong>Attribute:</strong> <code class="highlighter-rouge">data-title-tooltip</code></p>
  1012. </li>
  1013. <li>
  1014. <p><strong>Type:</strong> <code class="highlighter-rouge">String</code></p>
  1015. </li>
  1016. <li>
  1017. <p><strong>Detail:</strong></p>
  1018. <p>The column title tooltip text. This option also supports the title HTML attribute.</p>
  1019. </li>
  1020. <li>
  1021. <p><strong>Default:</strong> <code class="highlighter-rouge">undefined</code></p>
  1022. </li>
  1023. <li>
  1024. <p><strong>Example:</strong> <a href="https://examples.bootstrap-table.com/#column-options/title-tooltip.html">Title Tooltip</a></p>
  1025. </li>
  1026. </ul>
  1027. <h2 id="valign">valign</h2>
  1028. <ul>
  1029. <li>
  1030. <p><strong>Attribute:</strong> <code class="highlighter-rouge">data-valign</code></p>
  1031. </li>
  1032. <li>
  1033. <p><strong>Type:</strong> <code class="highlighter-rouge">String</code></p>
  1034. </li>
  1035. <li>
  1036. <p><strong>Detail:</strong></p>
  1037. <p>Indicate how to align the cell data. <code class="highlighter-rouge">'top'</code>, <code class="highlighter-rouge">'middle'</code>, <code class="highlighter-rouge">'bottom'</code> can be used.</p>
  1038. </li>
  1039. <li>
  1040. <p><strong>Default:</strong> <code class="highlighter-rouge">undefined</code></p>
  1041. </li>
  1042. <li>
  1043. <p><strong>Example:</strong> <a href="https://examples.bootstrap-table.com/#column-options/aligning-columns.html">Aligning Columns</a></p>
  1044. </li>
  1045. </ul>
  1046. <h2 id="visible">visible</h2>
  1047. <ul>
  1048. <li>
  1049. <p><strong>Attribute:</strong> <code class="highlighter-rouge">data-visible</code></p>
  1050. </li>
  1051. <li>
  1052. <p><strong>Type:</strong> <code class="highlighter-rouge">Boolean</code></p>
  1053. </li>
  1054. <li>
  1055. <p><strong>Detail:</strong></p>
  1056. <p>Set <code class="highlighter-rouge">false</code> to hide the columns item.</p>
  1057. </li>
  1058. <li>
  1059. <p><strong>Default:</strong> <code class="highlighter-rouge">true</code></p>
  1060. </li>
  1061. <li>
  1062. <p><strong>Example:</strong> <a href="https://examples.bootstrap-table.com/#column-options/visible.html">Column Visible</a></p>
  1063. </li>
  1064. </ul>
  1065. <h2 id="width">width</h2>
  1066. <ul>
  1067. <li>
  1068. <p><strong>Attribute:</strong> <code class="highlighter-rouge">data-width</code></p>
  1069. </li>
  1070. <li>
  1071. <p><strong>Type:</strong> <code class="highlighter-rouge">Number</code></p>
  1072. </li>
  1073. <li>
  1074. <p><strong>Detail:</strong></p>
  1075. <p>The width of the column. If not defined, the width will auto expand to fit its contents. Though if the table is left responsive and sized too small, this <code class="highlighter-rouge">'width'</code> might be ignored (use min/max-width via class or such then). The default used unit is ‘px’. Use <code class="highlighter-rouge">widthUnit</code> to change it!</p>
  1076. </li>
  1077. <li>
  1078. <p><strong>Default:</strong> <code class="highlighter-rouge">undefined</code></p>
  1079. </li>
  1080. <li>
  1081. <p><strong>Example:</strong> <a href="https://examples.bootstrap-table.com/#column-options/width.html">Column Width</a></p>
  1082. </li>
  1083. </ul>
  1084. <h2 id="widthunit">widthUnit</h2>
  1085. <ul>
  1086. <li>
  1087. <p><strong>Attribute:</strong> <code class="highlighter-rouge">data-width-unit</code></p>
  1088. </li>
  1089. <li>
  1090. <p><strong>Type:</strong> <code class="highlighter-rouge">String</code></p>
  1091. </li>
  1092. <li>
  1093. <p><strong>Detail:</strong></p>
  1094. <p>Defines the unit which is used for the option <code class="highlighter-rouge">width</code>.</p>
  1095. </li>
  1096. <li>
  1097. <p><strong>Default:</strong> <code class="highlighter-rouge">px</code></p>
  1098. </li>
  1099. <li>
  1100. <p><strong>Example:</strong> <a href="https://examples.bootstrap-table.com/#column-options/width-unit.html">Width Unit</a></p>
  1101. </li>
  1102. </ul>
  1103. </main>
  1104. </div>
  1105. </div>
  1106. <script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
  1107. <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script>
  1108. <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.min.js"></script>
  1109. <script async defer src="https://buttons.github.io/buttons.js"></script><script src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"></script>
  1110. <script>
  1111. $(function () {
  1112. $('.bd-content.api a').attr('target', '_blank')
  1113. })
  1114. </script><script src="https://gg.wenzhixin.net.cn/bootstrap-table/gg.js"></script>
  1115. <script src="/assets/js/docs.min.js?m=1"></script>
  1116. <!-- Global site tag (gtag.js) - Google Analytics -->
  1117. <script async src="https://www.googletagmanager.com/gtag/js?id=UA-132747866-1"></script>
  1118. <script>
  1119. window.dataLayer = window.dataLayer || []
  1120. function gtag() {window.dataLayer.push(arguments)}
  1121. gtag('js', new Date())
  1122. gtag('config', 'UA-132747866-1')
  1123. </script>
  1124. </body>
  1125. </html>