I don’t see what having titles has to do with using tables. You mean a title above or below the video right?
Anyway, using tables, your code would want to be something like this:
<table>
<tr>
<td>
<h1><strong>$row['text']</strong></h1>
<iframe title=\\"YouTube video player\\" src=\\"http://www.youtube.com/embed/\\" . $row['link'] . "\\" width=\\"426\\" height=\\"240\\" frameborder=\\"0\\"></iframe>
</td>
<td>
<h1><strong>$row['text']</strong></h1>
<iframe title=\\"YouTube video player\\" src=\\"http://www.youtube.com/embed/\\" . $row['link'] . "\\" width=\\"426\\" height=\\"240\\" frameborder=\\"0\\"></iframe>
</td>
</tr>
<tr>
<td>
<h1><strong>$row['text']</strong></h1>
<iframe title=\\"YouTube video player\\" src=\\"http://www.youtube.com/embed/\\" . $row['link'] . "\\" width=\\"426\\" height=\\"240\\" frameborder=\\"0\\"></iframe>
</td>
<td>
<h1><strong>$row['text']</strong></h1>
<iframe title=\\"YouTube video player\\" src=\\"http://www.youtube.com/embed/\\" . $row['link'] . "\\" width=\\"426\\" height=\\"240\\" frameborder=\\"0\\"></iframe>
</td>
</tr>
</table>
Now, I’ve put your title and video together in the cell (<td>). The important thing to note is how the table itself is structured.
In your code you are starting and closing a new row (<tr> and </tr>) for each video, so one video per row. If you wanted two videos per row, you would have two columns <td> … video … </td> <td> … video … </td> per row.
BUT, you do not want to be using tables, tables are not for layouts.
Instead you would do something like this with DIV’s and CSS:
HTML:
<div class="videocell">
<h1>6 flag caps in 1 game!!</h1>
<iframe title="YouTube video player" src="http://www.youtube.com/embed/uAXCD8l6qQY" width="426" height="240" frameborder="0"></iframe>
</div>
<div class="videocell">
<h1>OUCH!!</h1>
<iframe title="YouTube video player" src="http://www.youtube.com/embed/7v4PoBEIQ88" width="426" height="240" frameborder="0"></iframe>
</div>
<div class="videocell">
<h1>ILL FIGHT!!</h1>
<iframe title="YouTube video player" src="http://www.youtube.com/embed/xZuEKLsOACU" width="426" height="240" frameborder="0"></iframe>
</div>
<div class="videocell">
<h1>great video</h1>
<iframe title="YouTube video player" src="http://www.youtube.com/embed/NBF67np5FGk" width="426" height="240" frameborder="0"></iframe>
</div>
CSS:
.videocell
{
width: 426px;
float: left;
margin: 10px 5px 0px 5px;
}
.videocell h1
{
font-family: Verdana, Geneva, sans-serif;
font-size: 14px;
font-weight: bold;
}
iframe
{
float: left;
}
That will place each video next to each other within the allotted space. So if there is room for 3 videos side by side and you have 6 videos, you’ll have 2 rows of 3 videos.
If there is room for 2 side by side and 6 videos, you will have 3 rows of 2 videos.
Now if you wanted to enforce the width, so you can only have 2 videos side by side no matter what the users screen resolution is, you would nest them in a wrapper.
HTML:
<div class="wrapper">
<div class="videocell">
<h1>6 flag caps in 1 game!!</h1>
<iframe title="YouTube video player" src="http://www.youtube.com/embed/uAXCD8l6qQY" width="426" height="240" frameborder="0"></iframe>
</div>
<div class="videocell">
<h1>OUCH!!</h1>
<iframe title="YouTube video player" src="http://www.youtube.com/embed/7v4PoBEIQ88" width="426" height="240" frameborder="0"></iframe>
</div>
<div class="videocell">
<h1>ILL FIGHT!!</h1>
<iframe title="YouTube video player" src="http://www.youtube.com/embed/xZuEKLsOACU" width="426" height="240" frameborder="0"></iframe>
</div>
<div class="videocell">
<h1>great video</h1>
<iframe title="YouTube video player" src="http://www.youtube.com/embed/NBF67np5FGk" width="426" height="240" frameborder="0"></iframe>
</div>
</div>
CSS:
.wrapper
{
width: 872px;
}
.videocell
{
width: 426px;
float: left;
margin: 10px 5px 0px 5px;
}
.videocell h1
{
font-family: Verdana, Geneva, sans-serif;
font-size: 14px;
font-weight: bold;
}
iframe
{
float: left;
}
The width of the wrapper will need to account for the width of each cell (as in the iframe) and any padding/margin inside of / between each cell (DIV). I put 5px margin each side of the “videocell” DIV, so you have 10px margin total per cell, so each cell is the width of the iframe + 10px .