Hello, I'm using the fontawesome library to show some icons in some cells
<script defer src="https://use.fontawesome.com/releases/v5.0.8/js/all.js"></script>
I try to put it in the upper part of the cell, and with valign=”top”
or vertical-align: top
I get it.
When we are viewing the table on a horizontal screen, it looks good because each line of the table is shown on a single line.
On the other hand, when the screen is left vertical, the lines are shown double and the cell that contains the icon remains in the center, or even something lower.
So I show the icon
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="initial-scale=1.0, user-scalable=yes, width=device-width" />
<title>Titulo</title>
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
<script defer src="https://use.fontawesome.com/releases/v5.0.8/js/all.js"></script>
<style type="text/css">
.oculto1,.oculto2,.oculto3{
margin-left: 1%;
display: none;
}
.info2_submenu1 span{
padding-left: 15px;
}
td {
vertical-align: "top";
}
</style>
</head>
<body>
<div>
<p>
<p>
<div>
<a><button type="button" style='width:257px; text-align: left; font: 11pt arial;' onclick="window.open('pagina.htm','_self');">
<span><i style="font: 10pt comic sans ms; color: blue" class="fa fa-angle-double-right" aria-hidden="true"></i> Boton 1</span></button></a>
</div>
<div class="info1">
<a href="#info1"><button type="button" style='width:257px; text-align: left; font: 11pt arial'>Libro 1</button></a>
</div>
<div id="<info1></info1>" class="oculto1">
<table>
<tr>
<td><span style="font: 10pt comic sans ms; color: blue"> <i class="fa fa-angle-double-right" aria-hidden="true"></i></span></td>
<td style='font: 11pt arial'><a href="pagina.htm"> INDICE por artículos</a></td>
</tr>
<tr>
<td><span style="font: 10pt comic sans ms; color: blue"> <i class="fa fa-angle-double-right" aria-hidden="true"></i></span></td>
<td style='font: 11pt arial'><a href="pagina.htm"> Cap. 1 - Jujubes marzipan chocolate cake wafer biscuit. Biscuit powder danish croissant cupcake macaroon.Jujubes marzipan chocolate cake wafer biscuit. Biscuit powder danish croissant cupcake macaroon.</a></td>
</tr>
<tr>
<td><span style="font: 10pt comic sans ms; color: blue"> <i class="fa fa-angle-double-right" aria-hidden="true"></i></span></td>
<td><a href="pagina.htm"> Cap. 2 - Jujubes marzipan chocolate cake wafer biscuit. Biscuit powder danish croissant cupcake macaroon.Jujubes marzipan chocolate cake wafer biscuit. Biscuit powder danish croissant cupcake macaroon.Jujubes marzipan chocolate cake wafer biscuit. Biscuit powder danish croissant cupcake macaroon.Jujubes marzipan chocolate cake wafer biscuit. Biscuit powder danish croissant cupcake macaroon.</a></td>
</tr>
</table>
</div>
<div class="info2">
<a href="#info2"><button type="button" style='width:257px; text-align: left; font: 11pt arial'>Libro 2</button></a>
</div>
<div id="info2" class="oculto2">
<table>
<tr>
<td><span style="font: 10pt comic sans ms; color: blue"> <i class="fa fa-angle-double-right" aria-hidden="true"></i></span></td>
<td style='font: 11pt arial'><a href="pagina.htm"> INDICE</a></td>
</tr>
<tr>
<td><span style="font: 10pt comic sans ms; color: blue"> <i class="fa fa-angle-double-right" aria-hidden="true"></i></span></td>
<td style='font: 11pt arial'><a href="pagina.htm"> Sec. 1 - Jujubes marzipan chocolate cake wafer biscuit. Biscuit powder danish croissant cupcake macaroon.</a></td>
</tr>
<tr>
<td><span style="font: 10pt comic sans ms; color: blue"> <i class="fa fa-angle-double-right" aria-hidden="true"></i></span></td>
<td style='font: 11pt arial'><a href="pagina.htm"> Sec. 2 - Jujubes marzipan chocolate cake wafer biscuit. Biscuit powder danish croissant cupcake macaroon. </a></td>
</tr>
<tr>
<td><span style="font: 10pt comic sans ms; color: blue"> <i class="fa fa-file" aria-hidden="true"></i></span></td>
<td style='font: 11pt arial'><a href="#" class="info2_ET1"> Tema 1 - Jujubes marzipan chocolate cake wafer biscuit.</a></td>
</tr>
<tr hidden class="info2_submenu1">
<td></td>
<td>
<span style='font: 11pt arial'><a href="pagina.htm"><i style="color: blue" class="fa fa-angle-double-right" aria-hidden="true"></i> Cap. 1/Sec. 1 - Jujubes marzipan chocolate cake wafer biscuit.</a></span><br>
<span style='font: 11pt arial'><a href="pagina.htm"><i style="color: blue" class="fa fa-angle-double-right" aria-hidden="true"></i> Cap. 1/Sec. 2 - Jujubes marzipan chocolate cake wafer biscuit. Biscuit powder danish croissant cupcake macaroon.</a></span>
</td>
</tr>
</table>
</div>
<div class="info3">
<a href="#info3"><button type="button" style='width:257px; text-align: left; font: 11pt arial'>Libro 3</button></a>
</div>
<div id="info3" class="oculto3">
<table>
<tr>
<td><span style="font: 10pt comic sans ms; color: blue"> <i class="fa fa-angle-double-right" aria-hidden="true"></i></span></td>
<td style='font: 11pt arial'><a href="pagina.htm"> INDICE</a></td>
</tr>
<tr>
<td><span style="font: 10pt comic sans ms; color: blue"> <i class="fa fa-angle-double-right" aria-hidden="true"></i></span></td>
<td style='font: 11pt arial'><a href="pagina.htm"> Sec. 1 - Jujubes marzipan chocolate cake wafer biscuit. Biscuit powder danish croissant cupcake macaroon.</a></td>
</tr>
<tr>
<td><span style="font: 10pt comic sans ms; color: blue"> <i class="fa fa-angle-double-right" aria-hidden="true"></i></span></td>
<td style='font: 11pt arial'><a href="pagina.htm"> Sec. 2 - Jujubes marzipan chocolate cake wafer biscuit. Biscuit powder danish croissant cupcake macaroon. </a></td>
</tr>
</tr>
</table>
</div>
<div>
<a><button type="button" style='width:257px; text-align: left; font: 11pt arial;' onclick="window.open('pagina.htm','_self');">
<span><i style="font: 10pt comic sans ms; color: blue" class="fa fa-angle-double-right" aria-hidden="true"></i> INDICE</span></button></a>
</div>
</div>
<script type="text/javascript">
jQuery(document).ready(function(){
$('.info1').on('click',function(){
$('.oculto1').slideToggle('fast');
$('.oculto2').slideUp('fast');
$('.oculto3').slideUp('fast');
$('.info2_submenu1').slideUp('fast');
});
$('.info2').on('click',function(){
$('.oculto2').slideToggle('fast');
$('.oculto1').slideUp('fast');
$('.oculto3').slideUp('fast');
$('.info2_submenu1').slideUp('fast');
});
$('.info3').on('click',function(){
$('.oculto3').slideToggle('fast');
$('.oculto2').slideUp('fast');
$('.oculto1').slideUp('fast');
$('.info2_submenu1').slideUp('fast');
});
$('.info2_ET1').on('click',function(){
$('.info2_submenu1').slideToggle('fast');
});
});
</script>
</body>
</html>
I have even tried to align all the content of the <tabla>
and I have not succeeded.
As you can put the icon on the top of the cell so that when the content is displayed on more than one line, it looks good.