1
I am making a small Java Web application with Bootstrap, but I have an error on a page where I use a table. When I have more than eight rows in the table, the buttons that are below the table disappear, I thought the page would activate the page bearing or the table bearing itself. I don’t know how to make the page bearing appear. It follows below the code, the filling it is through Java, but I will insert some lines as hardcode for visualization effect, which is my problem.
PS: I’m not getting the code to use Boostrap here on the Stackoverflow page, which I find strange, since in the code I refer to online styling links and do not use links from local files. So I’ll put the execution image on my machine too.
Original Code
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Odonto Cascadura</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<!-- Custom styles for this template -->
<link href="sticky-footer.css" rel="stylesheet">
<!-- Google Font -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
</head>
<body>
<div class="container-fluid">
<header>
<nav class="navbar navbar-default" style="background-color: #4682B4; border-color: #4682B4;">
<ul class="nav navbar-nav">
<li><a href="#" style="color: #FFFFFF">Painel</a></li>
<li><a href="#" style="color: #FFFFFF">Agenda</a></li>
<li><a href="#" style="color: #FFFFFF">Pacientes</a></li>
<li><a href="#" style="color: #FFFFFF">Profissionais</a></li>
<li><a href="#" style="color: #FFFFFF">Financeiro</a></li>
<li><a href="#" style="color: #FFFFFF">Relatórios</a></li>
<li><a href="#" style="color: #FFFFFF">Configurações</a></li>
</ul>
</nav>
</header>
<div class="content-wrapper">
<section class="content">
<main>
<div class="box-header with-border">
<h3 class="box-title col-md-12">Pacientes</h3>
</div>
<!-- /.box-header -->
<table class="table table-hover" overflow="scroll">
<thead>
<tr>
<th> </th>
<th>Id</th>
<th>Nome</th>
<th>CPF</th>
<th>RG</th>
</tr>
</thead>
<tbody>
<c:forEach var="paciente" items="${pacientes}">
<tr data-href="#">
<td><a class="btn btn-primary" href="mvc?logica=RemoverPacienteLogica&id_paciente=${paciente.id_paciente}">Remover</a></td> <td>${paciente.id_paciente}</td> <td>${paciente.nome_paciente}</td> <td>${paciente.rg}</td> <td>${paciente.cpf}</td>
</tr>
</c:forEach>
</tbody>
</table>
<script>
$(function(){
$('.table tr[data-href]').each(function(){
$(this).css('cursor','pointer').hover(
function(){
$(this).addClass('active');
},
function(){
$(this).removeClass('active');
}).click( function(){
document.location = $(this).attr('data-href');
}
);
});
});
</script>
<!-- /.tabpanel 3 -->
<!-- <nav aria-label="Page navigation">
<ul class="pagination">
<li><a href="#aba1" role="tab" data-toggle="tab">1</a></li>
<li><a href="#aba2" role="tab" data-toggle="tab">2</a></li>
<li><a href="#aba3" role="tab" data-toggle="tab">3</a></li>
</ul>
</nav>
<script>
submitForms = function(){
document.getElementById("form1").submit();
}
</script> -->
</main>
<button type="button" class="btn btn-primary">Novo Procedimento</button>
<a href="mvc?logica=NovoPacienteLogica" role="button" class="btn btn-primary">Novo Paciente</a>
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
</div>
<!-- /.container-fluid -->
<footer class="navbar navbar-inverse navbar-fixed-bottom" style="background-color: #4682B4; border-color: #4682B4;">
<div class="container-fluid">
<p class="text-muted"><font color="#FFFFFF"> Odontologia</font></p>
</div>
</footer>
</body>
</html>
Hardcode code for visibility issues
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Odonto Cascadura</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<!-- Custom styles for this template -->
<link href="sticky-footer.css" rel="stylesheet">
<!-- Google Font -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
</head>
<body>
<div class="container-fluid">
<header>
<nav class="navbar navbar-default" style="background-color: #4682B4; border-color: #4682B4;">
<ul class="nav navbar-nav">
<li><a href="#" style="color: #FFFFFF">Painel</a></li>
<li><a href="#" style="color: #FFFFFF">Agenda</a></li>
<li><a href="#" style="color: #FFFFFF">Pacientes</a></li>
<li><a href="#" style="color: #FFFFFF">Profissionais</a></li>
<li><a href="#" style="color: #FFFFFF">Financeiro</a></li>
<li><a href="#" style="color: #FFFFFF">Relatórios</a></li>
<li><a href="#" style="color: #FFFFFF">Configurações</a></li>
</ul>
</nav>
</header>
<div class="content-wrapper">
<section class="content">
<main>
<div class="box-header with-border">
<h3 class="box-title col-md-12">Pacientes</h3>
</div>
<!-- /.box-header -->
<table class="table table-hover" overflow="scroll">
<thead>
<tr>
<th> </th>
<th>Id</th>
<th>Nome</th>
<th>CPF</th>
<th>RG</th>
</tr>
</thead>
<tbody>
<tr data-href="#">
<td><a class="btn btn-primary" href="#">Remover</a></td> <td>1</td> <td>aaaa</td> <td>1111</td> <td>2222</td></tr>
<tr data-href="#">
<td><a class="btn btn-primary" href="#">Remover</a></td> <td>1</td> <td>aaaa</td> <td>1111</td> <td>2222</td></tr>
<tr data-href="#">
<td><a class="btn btn-primary" href="#">Remover</a></td> <td>1</td> <td>aaaa</td> <td>1111</td> <td>2222</td></tr>
<tr data-href="#">
<td><a class="btn btn-primary" href="#">Remover</a></td> <td>1</td> <td>aaaa</td> <td>1111</td> <td>2222</td></tr>
<tr data-href="#">
<td><a class="btn btn-primary" href="#">Remover</a></td> <td>1</td> <td>aaaa</td> <td>1111</td> <td>2222</td></tr>
<tr data-href="#">
<td><a class="btn btn-primary" href="#">Remover</a></td> <td>1</td> <td>aaaa</td> <td>1111</td> <td>2222</td></tr>
<tr data-href="#">
<td><a class="btn btn-primary" href="#">Remover</a></td> <td>1</td> <td>aaaa</td> <td>1111</td> <td>2222</td></tr>
<tr data-href="#">
<td><a class="btn btn-primary" href="#">Remover</a></td> <td>1</td> <td>aaaa</td> <td>1111</td> <td>2222</td></tr>
<tr data-href="#">
<td><a class="btn btn-primary" href="#">Remover</a></td> <td>1</td> <td>aaaa</td> <td>1111</td> <td>2222</td></tr>
</tbody>
</table>
<script>
$(function(){
$('.table tr[data-href]').each(function(){
$(this).css('cursor','pointer').hover(
function(){
$(this).addClass('active');
},
function(){
$(this).removeClass('active');
}).click( function(){
document.location = $(this).attr('data-href');
}
);
});
});
</script>
<!-- /.tabpanel 3 -->
<!-- <nav aria-label="Page navigation">
<ul class="pagination">
<li><a href="#aba1" role="tab" data-toggle="tab">1</a></li>
<li><a href="#aba2" role="tab" data-toggle="tab">2</a></li>
<li><a href="#aba3" role="tab" data-toggle="tab">3</a></li>
</ul>
</nav>
<script>
submitForms = function(){
document.getElementById("form1").submit();
}
</script> -->
</main>
<button type="button" class="btn btn-primary">Novo Procedimento</button>
<a href="mvc?logica=NovoPacienteLogica" role="button" class="btn btn-primary">Novo Paciente</a>
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
</div>
<!-- /.container-fluid -->
<footer class="navbar navbar-inverse navbar-fixed-bottom" style="background-color: #4682B4; border-color: #4682B4;">
<div class="container-fluid">
<p class="text-muted"><font color="#FFFFFF"> Odontologia</font></p>
</div>
</footer>
</body>
</html>
Page with table with 8 records
Table page with less than 8 records
Yes, Hugo does. But if I wanted to keep the buttons fixed? With the bar just rolling the table, how would I?
– Lucas Ferreira
@Lucasferreira I believe that can do yes. You would have a problem if they were just above the footer fixed, even if you only had two results in the table for example?
– hugocsl
There would be no problem.
– Lucas Ferreira
@Lucasferreira edited the answer and put in Option 1 the proposal of the Btns always at the end of the page, has some details in this option, but for now can serve you. A Option 2 is with the Btns at the end of the Scroll.
– hugocsl