asp flow layout?

pamela rizk
pamela rizk used Ask the Experts™
dear all
i need an html table where i need to add 6 column maximum in example and then data will be dsiplayed row by row wich means if a data contains 18 values and i need to display them in  atable

i need a table that can maximum fill 6 columns
so in my example i will have 3 rows and in every row i have 6columns hoiw to do that
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
pamela rizkDeveloper


any news?
HTML tables are fixed by nature, however you can re-define them based on the number of cell data elements you want to populate.

For this example, Iassume all the data is in an array (I like ArrayLists):

myData(17) ' contains 18 data elements

dim output as string = ""
dim rowCellCount as integer = 1 ' initialize to first cell of row
Dim cellsPerRow as integer = 6

For x as integer = 0 to myData.Length -1

If x = 0 ' Build opening table tag & first row tag ...
   output &= "<table>" & vbCrLf
End If

If rowCellCount = 1 Then ' start a row
   output &= "<tr>" & vbCrLf
End If

' add cell with data
output &= "<td>" & myData(x) " </td>"

if rowCellCount = cellsPerRow Then
   ' finish the row ...
   output &= vbCrLf
   output &= "</tr>" & vbCrLf
   rowCellCount =1
   rowCellCount += 1
End If

' table has been populated. End the table
output &= "</table>"

Open in new window

There are a multitude of techniques to use if the data doesn't fully populate the table structure.

Good luck!
thank you i solved my issye using division with style ="display:inline block"
this solve my problem

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial