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

Ian replied to Ian's discussion Side Backgound Image keeps shrinking and orienting left & animated gif header isn't working
"Don't let our temporary fix fool you regarding the background (side) image.  NING is still not prop…"
4 hours ago
Jen replied to Ian's discussion Side Backgound Image keeps shrinking and orienting left & animated gif header isn't working
"I just spent the past hour helping Ian troubleshoot this issue. The Ning platform is definitely bre…"
4 hours ago
Ian replied to Ian's discussion Side Backgound Image keeps shrinking and orienting left & animated gif header isn't working
""STRANGE FACT: SINCE WE PUT THE 'CHUCK BERRY' ANIMATED GIF ON THE HOME PAGE ALL OTHER ANIMATED GIFS…"
7 hours ago
Ian replied to Bryce Rubio's discussion A Follow-Up Message from our CEO
"In fact, all of our animated gifs are disabled except for a small few, and now we can't upload any…"
7 hours ago
Ian replied to Ian's discussion Side Backgound Image keeps shrinking and orienting left & animated gif header isn't working
"Gifs have apparently been deactivated across the board, except for a couple.  Strange.  Help."
7 hours ago
Ian replied to Ian's discussion Side Backgound Image keeps shrinking and orienting left & animated gif header isn't working
"In fact, we can't upload any new animated gifs apparently."
7 hours ago
Ian replied to Bryce Rubio's discussion A Follow-Up Message from our CEO
"Hello Bryce, recently our side image is not uploading properly and our top bar animated gif and hea…"
7 hours ago
Nieve replied to Bryce Rubio's discussion A Follow-Up Message from our CEO
"Like several people who spoke here, I have my Ning Network 2.0 since January 2009. It is a small, n…"
17 hours ago
George H. Compton IV replied to George H. Compton IV's discussion ( TIP N3 ) Allow your members to add CSS codes to the new profile text box.
"It looks like Ning is having problems with their text boxes :-( I can't even save plain text in the…"
17 hours ago
Aurora replied to George H. Compton IV's discussion ( TIP N3 ) Allow your members to add CSS codes to the new profile text box.
"I could not figure out where to put the code so it can work"
yesterday
Aurora replied to AnGella's discussion Ning 3.0 Tip: Add CSS to Member Profiles
"I think this does not work anymore I tried to do it but it did not work, it only worked if the memb…"
yesterday
Bizz ( John ) replied to Bizz ( John )'s discussion Why Are The Events Not Listing The Same Way As UpComing In My Events Or Categories ?
"Unless I am mistaken it looks like this has been fixed today. ( Sat 25/03/17 )"
yesterday
Thisisbully replied to Mike Collins's discussion Ning Development - Roadmap
"a lot of stuff has been added they just didn't post it yet .For instance the comment wall in groups…"
yesterday
Alliance replied to Mike Collins's discussion Ning Development - Roadmap
"i agree a roadmap from April would be appreciated if you could. It gives us time to decide on work…"
Friday
Kos replied to Bizz ( John )'s discussion Why Are The Events Not Listing The Same Way As UpComing In My Events Or Categories ?
"Yes sir"
Friday
More…