Student.php
<?php
namespace App\Http\Controllers;
class Student{
public static $students=[
];
}
?>
info.blade.php
<body>
<div class="col-md-8">
<h3 style="text-align: center;">学生信息</h3>
<table class="table table-hover table2_4 " style="text-align: center;" align="center"border=0; >
<tr>
<th>编号</th>
<th>学号</th>
<th>姓名</th>
<th>专业</th>
<th>班级</th>
<th>性别</th>
</tr>
@foreach ($students as $item)
<!-- @if ($loop->index%2)
<tr class="table-dark" align="center" >
@else
<tr align="center" >
@endif -->
<tr align="center" >
<td>{{$item['id']}} </td>
<td>{{$item['xh']}} </td>
<td><a href="{{route('ph.show',$item['xh'])}}">{{$item['xingming']}}</a></td>
<td>{{$item['zhuanye']}}</td>
<td>{{$item['banji']}}</td>
<td>{{$item['xingbie']}}</td>
</tr>
</table>
</div>
<style type="text/css">
.bgcolor{
background-color:lightblue ;
}
.table2_4 table {
width:100%;
margin:15px 0
}
.table2_4 th {
background-color:lightblue;
color:white;
}
.table2_4,.table2_4 th,.table2_4 td
{
font-size:20px;
text-align:center;
padding:4px;
border:1px solid
border-collapse:collapse
}
.table2_4 tr:nth-child(odd){
background-color:
}
.table2_4 tr:nth-child(even){
background-color:
}
</style>
detail.blade.php
<body>
<div class="col-md-8">
<h1 align="center" >学生详细信息</h1>
<table class="table table-hover table2" >
<caption>信息学院</caption>
<tr>
<th>学号</th>
<th>姓名</th>
<th>性别</th>
<th>年级</th>
<th>专业</th>
<th>班级</th>
<th>教育方式</th>
</tr>
<tr >
@if (empty($stu))
<h2 style="color: blue;" align="center">!!!没有该学生信息</h2>
@else
<td >{{$stu['xh']}} </td>
<td>{{$stu['xingming']}}</td>
<td>{{$stu['xingbie']}}</td>
<td>{{$stu['nianji']}}</td>
<td>{{$stu['zhuanye']}}</td>
<td>{{$stu['banji']}}</td>
<td>{{$stu['xuexixingshi']}}</td>
@endif
</tr>
</table>
</div>
<style type="text/css">
.table2 th {
background-color:lightblue;
color:white;
}
.table2 td{
background-color:
}
</style>
</body>
学生信息
详细信息
信息错误提示