Tables have a specific role in HTML but you may want to use DIVs in this circumstance. DIVs will automatically float and reposition themselves based on the width of the browser.
Here is a example in jsFiddle
HTML
<div class="table">
<div class="banner">The preferred developer response</div>
<div class="cell">
<img src="happy-icon.png">
</div>
...
<div class="banner">Other emotions</div>
<div class="cell">
<img src="sad-icon.png">
</div>
...
</div>
CSS
.table {
margin-left: 50px;
margin-right: 50px;
}
.banner {
padding: 10px;
margin-top: 20px;
clear: both;
background-color: #336699;
color: white;
font-weight: bold;
}
.cell {
width: 150px;
float: left;
}
Your code may look like this
Dim con5 As New SqlConnection
Dim cmd5 As New SqlCommand
Dim index As Integer = 0
Dim dt1 As New DataSet
con5.ConnectionString = ConfigurationSettings.AppSettings("ConnectionString")
con5.Open()
cmd5.Connection = con5
cmd5.CommandType = CommandType.StoredProcedure
cmd5.CommandText = "ProductBreakdown"
cmd5.Parameters.Add(New SqlParameter("ProductID", SqlDbType.Int)).Value = Session("Product")
cmd5.Parameters.Add(New SqlParameter("DesignName", SqlDbType.VarChar, 50)).Value = Request.QueryString("o")
Dim da1 As SqlDataAdapter = New SqlDataAdapter(cmd5)
da1.Fill(dt1)
dv = New DataView(dt1.Tables(0))
Dim strTable As New StringBuilder()
Dim itmCounter As Integer = 0
strTable.Append("<div class=""table""> ")
For Each dr As DataRowView In dv
Dim crossover As String = dr("CrossoverID").ToString()
Dim picid As String = dr("Description").ToString()
Dim picdescrip As String = dr("DesignColor").ToString().ToUpper()
Dim collectionname As String = dr("CollectionDescription").ToString().ToUpper()
Dim designinfo As String = dr("DesignName").ToString()
Session("Collection") = dr("CollectionDescription").ToString()
strTable.Append("<div class=""cell""><a href=""Sheet Vinyl Tile Product Page.aspx?p=" & crossover & "&o=" & designinfo & """>")
strTable.Append("<img src=""Images/Products/" + picid + ".jpg""width=""188"" height=""188"" border=""0"""" /><br/><br/>")
strTable.Append("<b><color=Black>" & collectionname & "</b><br />")
strTable.Append(picdescrip & "</a></div>")
itmCounter += 1
Next
strTable.Append("</div>")
product.InnerHtml = strTable.ToString()
Same great taste but fewer calories