Current status of the Ning Platform is always available on the Ning Status Blog.

Forum

NC for Hire

As we all know this is the generation of mobiles and mobiles are taking over other devices. So by having a non-responsive table element on your web-page you are letting down your visitor.

Here are some CSS tips on how to make a table or grid responsive.

Step 1:  First we will go with a basic HTML table format. Simply copy and paste this code into website's HTML.

<table class="altrowstable" id="alternatecolor">
<tr>
<th>Heading example 1</th><th>Heading example 2</th><th>Heading example 3</th>
</tr>
<tr>
<td>Example 1A</td><td>Example 1B</td><td>Example 1C</td>
</tr>
<tr>
<td>Text 2A</td><td>Example 2B</td><td>Example 2C</td>
</tr>
</tr>
<tr>
<td>Example 3A</td><td>Example 3B</td><td>Example 3C</td>
</tr>
<tr>
<td>Example 4A</td><td>Example 4B</td><td>Example 4C</td>
</tr>
<tr>
<td>Example 5A</td><td>Example 5B</td><td>Example 5C</td>
</tr>
</table>

Step 2 Now copy and paste the javascript and CSS code into CUSTOM CODE (End of Page Code). This CSS table uses Javascript to automatically alternate row colors. 

That's it.

<!-- GRID TABLE STYLE  bernardmax2@gmail.com -->
<script type="text/javascript">
function altRows(id){
if(document.getElementsByTagName){

var table = document.getElementById(id);
var rows = table.getElementsByTagName("tr");

for(i = 0; i < rows.length; i++){
if(i % 2 == 0){
rows[i].className = "evenrowcolor";
}else{
rows[i].className = "oddrowcolor";
}
}
}
}
window.onload=function(){
altRows('alternatecolor');
}
</script>

<style type="text/css">
table.altrowstable {
font-family: verdana,arial,sans-serif;
font-size:11px;
color:#333333;
border-width: 1px;
border-color: #a9c6c9;
border-collapse: collapse;
}
table.altrowstable th {
border-width: 1px;
padding: 8px;
border-style: solid;
border-color: #a9c6c9;
font-weight: bold;
}
table.altrowstable td {
border-width: 1px;
padding: 8px;
border-style: solid;
border-color: #a9c6c9;
}
.oddrowcolor{
background-color:#d4e3e5;
}
.evenrowcolor{
background-color:#c3dde0;
}
</style>

Example 

Live Example  Click here 

If you have any questions or want me to help you for any kind of Ning custom job or ning re-designing jobs, feel free to contact me @ bernardmax2@gmail.com

Follow us on facebook https://www.facebook.com/ningtips

.

You need to be a member of Ning Creators Network to add comments!

Join Ning Creators Network

Email me when people reply –

Replies

  • NC for Hire

    Nice tip Bernard!  Happy New Year!

  • Sweet!  Thank you Bernard

  • NC for Hire

    Thank you Jfarrow and KOS. Wishing you a happy new year....

  • The tables adjust on phone.

    Is anyway it can add colums/rows automatically 

    Thx

    • NC for Hire

      Hi Sam, in this tip you need to add columns and rows manually.However, there is a way to do so.

      Best

      Bernard

This reply was deleted.

Search the Creators Network

Latest Activity

Dan Lee replied to Dan Lee's discussion I Will Design Your Ning Network To Make it Look More Professional
"No it not."
11 hours ago
Dan Lee replied to Bizz ( John )'s discussion Adjusting Your Videos List Page Metadata Section Colours
"THIS CODE DIDN'T CHANGE THE COLOR FOR MY SITE"
11 hours ago
Dan Lee replied to Bizz ( John )'s discussion Adjusting Your Videos List Page Metadata Section Colours
"OK, I FOUND IT :)"
12 hours ago
Alliance replied to Dan Lee's discussion I Will Design Your Ning Network To Make it Look More Professional
"http://deeday504.com/ is a NING site?"
12 hours ago
Bizz ( John ) replied to Bizz ( John )'s discussion Video Issues Again For Embed Videos Showing Blank Box
"Here you go Dan this should fix you up
http://creators.ning.com/forum/topics/adjusting-your-videos-&he...;"
18 hours ago
Dan Lee replied to Dan Lee's discussion I Will Design Your Ning Network To Make it Look More Professional
21 hours ago
Hantz Jeanlouis is now a member of Ning Creators Network
yesterday
Traddie replied to Dan Lee's discussion I Will Design Your Ning Network To Make it Look More Professional
"Do you have examples of other sites you have designed?"
yesterday
Bizz ( John ) replied to Bizz ( John )'s discussion Video Issues Again For Embed Videos Showing Blank Box
"I have a fix for this. Will post it as a tip when home later this evening.
John :-)"
yesterday
Ning via Facebook

#unitewithNING Ning`s conquering Internet: follow our new Google+ page here!…

Dan Lee replied to Bizz ( John )'s discussion Video Issues Again For Embed Videos Showing Blank Box
"ANY FIX FOR THE COLOR OF THE TEXT, FOR THE NEW VIDEO FEATURE? WHEN I ADDED IT TO MY HOME PAGE I GOT…"
yesterday
Garfield Archivist replied to Bizz ( John )'s discussion Ning: Is it possible to enable the comments form on posted videos like we can for photos in activity feed.
"Me Three"
yesterday
⚡JFarrow⌁ replied to Bizz ( John )'s discussion Ning: Is it possible to enable the comments form on posted videos like we can for photos in activity feed.
"i second that"
yesterday
Ning via Facebook

#inspirewithNING #dj Feel inspired with cheerful spring and joyful minutes, filled with sounds…

Kos replied to Anastasiia_NING support's discussion Ning 2Q 2017 plan!
"What, in 2.0 themes, do you want Tony?  Most can be replicated with simple CSS.  Can you be more sp…"
yesterday
Kos replied to Bizz ( John )'s discussion Ning: Is it possible to enable the comments form on posted videos like we can for photos in activity feed.
""
yesterday
Bizz ( John ) replied to Bizz ( John )'s discussion Videos Playing In Activity Feed, check it out on my site, Now shows photos to ( Updated: 27-04-17 )
"Added some more updates on this so it works with photos now also."
yesterday
Tim Frank replied to Anastasiia_NING support's discussion Ning 2Q 2017 plan!
"Thank you for the answer. My only regret is that it took just short of a month to get an empathetic…"
yesterday
Kyryl_Ning_Support replied to Bizz ( John )'s discussion Ning- Your design studio widget images are not loading
"Thanks, John,
I have posted the info about the fix of the embedded videos under more appropriate po…"
yesterday
Bizz ( John ) replied to Bizz ( John )'s discussion Video Issues Again For Embed Videos Showing Blank Box
"Yes I noticed that but I don't think that's a big issue as at least the embeds are working now and…"
yesterday
More…