---
title: "easy ui easyui-datagrid 高度自动设置"
author: "jeelee"
date: "2016-11-30T23:12:41Z"
tags: []
categories: ["Web前端"]
slug: "easy-ui-easyui-datagrid"
draft: false
lastmod: "2016-11-30T23:12:41Z"
id: 2342160
url: "https://jeelee.iteye.com/blog/2342160"
---

<table id="dg" class="easyui-datagrid" style="width:100%"
			data-options="rownumbers:true,singleSelect:false,selectOnCheck:false,checkOnSelect:false,toolbar:'#tb',footer:'#ft',
			collapsible:true,
			pagination:true,
			<span style="color:red">fit:true,</span>
			url:''">
		<thead>
			<tr>
				<th data-options="field:'ck',checkbox:true,width:80"></th>
				<th data-options="field:'opt',title:'操作',width:90,align:'center'"></th>
				<th data-options="field:'systemId'">System ID</th>
				<th data-options="field:'systemName'">System Name</th>
				<th data-options="field:'enableFlag',width:60,align:'center'">Enable</th>
				<th data-options="field:'systemFlag',width:60,align:'center'">System Flag</th>
				<th data-options="field:'createdUserName',align:'center'">Created User</th>
				<th data-options="field:'creationDate',align:'center'">Creation Date</th>
				<th data-options="field:'lastUpdateUserName',align:'center'">Last Update User</th>
				<th data-options="field:'lastUpdateDate',align:'center'">Last Update Date</th>
			</tr>
		</thead>
	</table>

datagrid加上 fit:true 就可以了