css responsive table

I'm upgrading our website to be mobile compatible using responsive design and have run into a snag.

We have a 3 column table
[example]
<B>Beverages</B>    <B>Sandwiches</B>       <B>Cookies<B>
       Soda                           Tuna                               Oreo
       Water                         Bologna                          Chocolate Chip
       Tea                             Ham & Swiss                  Oatmeal
       etc                              etc                                   etc

When the page is viewed by a small screen I'm trying to get the table to display like
[example]
<B>Beverages</B>
       Soda
       Water
       Tea

<B>Sandwiches</B>
       Tuna
       Bologna
       Ham & Swiss

<B>Cookies</B>
       Oreo
       Chocolate Chip
       Oatmeal

I've viewed countless tutorials, demo's, samples, etc but they all work with data from left to right
(Most recently - https://css-tricks.com/responsive-data-tables/)

Any help would be greatly appreciated

Ken
LVL 16
kenfcampAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kyle HamiltonData ScientistCommented:
your data isnt really a table anyway, so i woulnd use table elements to start with. what you have are three columns side by side. use lists and either float then left, or display inline. then at a certain view port width, remove the float, or set to display block.
0
kenfcampAuthor Commented:
Actually, now that I think about it space wise
Something like the following might work better

[col1]                              [col2]
                                        Soda
<B>Beverages</B>         Water
                                        Tea
     
                                        Tuna
<B>Sandwiches</B>      Bologna
                                        Ham & Cheese  

                                        Oreo
<B>Cookies</B>             Chocolate Chip
                                        Oatmeal
0
kenfcampAuthor Commented:
It's a table, I just typed in the data format w/o the HTML portion
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

kenfcampAuthor Commented:
Here's the sample data in table format

<table>
<thead>
<tr>
<th><b>Beverages</b></th>
<th><b>Sandwiches</b></th>
<th><b>Cookies</b></th>
</tr>
</thead>
<tbody>
<tr>
<td>Soda</td>
<td>Tuna</td>
<td>Oreo</td>
</tr>
<tr>
<td>Water</td>
<td>Bologna</td>
<td>Chocolate Chip</td>
</tr>
<tr>
<td>Tea</td>
<td>Ham & Swiss</td>
<td>Oatmeal</td>
</tr>
</tbody>
</table>
0
Kyle HamiltonData ScientistCommented:
a table is an object with rows and columns. where each row is an object having the properties defined by each column. . so unless each row in your dataset represents a discrete object, it is not actually a table. i'm not saying this to make you feel bad, i'm trying to help define the data and come up with the most appropriate solution. so what you have are 3 columns. this is actually a good thing. much easier to think about. did you try the list suggestion?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Kyle HamiltonData ScientistCommented:
sorry, just saw your post. however, even though you are displaying the data using an html table, it is still not a table. the table is being used for layout purposes only. in modern web dev, that's a no-no
0
Kyle HamiltonData ScientistCommented:
of course I could be wrong :)

is "Soda, Tuna, and Oreo" a meal? is it a table of meals, where each row is a meal? then I'm wrong, and you do actually have a table.

Otherwise you have three lists.

Cheers.
0
kenfcampAuthor Commented:
Ended up going a different route.
The list suggestion wouldn't work for what I'm working with, however the suggestion did give me an idea I hadn't thought of :)

Thanks for the help
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.