list嵌套顯示


.dept-content{
    width: 790px;
    float: left;
    margin: 20px 0 0 10px;

}

.dept-table{
    margin-top: 20px;
}

.dept-title{
    width:100%;
    border:1px solid #00c9cb;
    padding: 10px 0;
    font-size: 16px;
    background:rgba(0, 131, 133, 0.2);
}

.dept-title p{
    text-align: center;
    color: #008385;
    
}

.dept-table table{
    border: 1px solid #dddddd;
}

.td-w20{
    width: 20%;
}

.in li{
    list-style-position:inside;
    margin: 10px 0 10px 5px;
}

.disc{
    list-style-type:disc ;
    color:rgba(0, 131, 133, 0.2);
    width:100%;
    float:left;
    border:1px solid #dddddd;
}

.in a{
    color:#999999;
}

 
<span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">頁面:</span>
<div class="dept-content">
		<div class="dept-table">
			<c:forEach var="dict" items="${dictList}">
				<div style="width:100%;float:left;margin-bottom:15px;">
					<div class="dept-title">
						<p>
							<ph:dictValue dictCode="${dict.dictCode }" />
						</p>
					</div>
					<ul class="in disc" style="width:100%;float:left;border:1px solid #dddddd;">
						<c:forEach var="dept" items="${dict.deptList}">
							<li style="float:left;width:19%"><a href="#" title="${dept.name}">${dept.name}</a></li>
						</c:forEach>
					</ul>
				</div>
			</c:forEach>
		</div>
	</div>

後臺:

 

@RequestMapping(value="/f/department/alldept")
	public String test(@ModelAttribute Department department,ModelMap model)throws Exception{
		List<SysDict> dictList = (List<SysDict>)DictUtils.getDictMap().get("department.category");
		for (int i = 0; i < dictList.size(); i++) {
			SysDict dict = dictList.get(i);
			String categoryId = dict.getDictCode();
			List<Department> deptList = departmentService.getDeptNameList(categoryId);
			dict.setDeptList(deptList);
		}
		model.addAttribute("dictList", dictList);
		return "f/department/alldept";
	}

效果:

 


 

發佈了26 篇原創文章 · 獲贊 39 · 訪問量 13萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章