How can I align the tables vertically ?
so that
Number 546
Lottery 1
aligns under the column Linked Element
Number 547
Lottery 2
falls under the column Linked Element1
Number 548
Lottery 3
falls under the column Linked Element2
https://onecompiler.com/html/3zyvupx94
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</=
head>
<body>
<br>
<html>
<body>
<br><br><br>
<table width="300" table-layout:fixed border="1">
<tr>
<td>
<table width="300" table-layout=fixed border="0" rules="none">
<tr> Linked Element</tr>
<tr>
<td><img src="img_girl.jpg" height="180" width="180" border="0"></td>
</tr>
<tr>
<td> 546 Lottery 1</td>
<tr>
</table>
</td>
<br>
<br>
<td>
<table width="300" table-layout=fixed border="0" rules="none">
<tr> Linked Element1</tr>
<tr>
<td><img src="img_girl.jpg" height="180" width="180" border="0"></td>
</tr>
<tr>
<td> 547 Lottery 1</td>
<tr>
</table>
</td>
<br>
<br>
<td>
<table width="300" table-layout=fixed border="0" rules="none">
<tr> Linked Element2</tr>
<tr>
<td><img src="img_girl.jpg" height="180" width="180" border="0"></td>
</tr>
<tr>
<td> 548 Lottery 1</td>
<tr>
</table>
</td>
<br>
<br>
<table width="300" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td> Number 546</td>
</tr>
<tr>
<td> Lottery 1</td>
</tr>
</tbody>
</table>
<table width="300" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td> Number 547</td>
</tr>
<tr>
<td> Lottery 1</td>
</tr>
</tbody>
</table>
<table width="300" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td> Number 548</td>
</tr>
<tr>
<td> Lottery 1</td>
</tr>
</tbody>
</table>
</tr>
</table>
</body>
</html>
4
Answers
To align the tables vertically, you need to structure your HTML in a way that each "Linked Element" and its corresponding "Number" and "Lottery" are in the same table cell (
<td>
).In this code, each "Linked Element", "Number", and "Lottery" are in separate rows (
<tr>
) within the same table cell (<td>
). The outer table has three cells, one for each "Linked Element". This will align the tables vertically as you wanted.Using css- Set float:left on the divs so they align horizontally
Add some margin-right space between the divs.
Here is the updated code: https://onecompiler.com/html/3zyvxa8p9
Assalam Alaikum.
I understand you want a flexible schedule. If so, it’s very easy. css will help you for this.