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 Social Network to add comments!

Join Ning Creators Social 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

Cindy Dean Mccoy replied to Kyryl_Ning_Support's discussion Chat Feature Update on Ning 3.0 is ready!
"Yep.  I was going to do that tomorrow if ours is still now working correctly.  I am sure they have…"
51 minutes ago
Kos replied to Kyryl_Ning_Support's discussion Chat Feature Update on Ning 3.0 is ready!
"Cindy Update your support ticket - tell them what's happening.  Remember, support is not here in th…"
1 hour ago
Cindy Dean Mccoy replied to Kyryl_Ning_Support's discussion Chat Feature Update on Ning 3.0 is ready!
"Ours is still not working properly.  I can see those online now.  If I post a comment in chat, ther…"
1 hour ago
Manuel Adame Jimenez replied to Kyryl_Ning_Support's discussion Chat Feature Update on Ning 3.0 is ready!
""
1 hour ago
Manuel Adame Jimenez replied to Kyryl_Ning_Support's discussion Chat Feature Update on Ning 3.0 is ready!
""
1 hour ago
Kos replied to Kyryl_Ning_Support's discussion Chat Feature Update on Ning 3.0 is ready!
"Chat is back.  Thank goodness!  I was close to screaming at support last night. Glad they finally g…"
1 hour ago
Brandyn Shepherd replied to Kyryl_Ning_Support's discussion Network not launched yet issue
"When a member likes their profile page or anything else it always says they shared it on facebook -…"
1 hour ago
Thisisbully replied to Kyryl_Ning_Support's discussion Chat Feature Update on Ning 3.0 is ready!
"I did I'm using a chat I had built for me works perfect"
1 hour ago
Ning via Facebook

#Ning #tips #followus Gather first followers, using 3 main secrets of effective social…

Brandyn Shepherd replied to Kyryl_Ning_Support's discussion Chat Feature Update on Ning 3.0 is ready!
"This is just me... but, I am thinking about disabling chat completely until the next update.It is a…"
1 hour ago
Brandyn Shepherd replied to Kyryl_Ning_Support's discussion Chat Feature Update on Ning 3.0 is ready!
"I really hope you guys plan on going back to the old chat format... or change this format to work l…"
2 hours ago
Brendon R Culliton replied to Kyryl_Ning_Support's discussion Network not launched yet issue
"Is anyone else having issues with the preview images not being fetched properly for new entries whe…"
2 hours ago
Brandyn Shepherd replied to Yana Ning Support's discussion Product Plan Update
"My chat is working again. Thanks Ning! One thing I noticed is that when you look at the who's onlin…"
2 hours ago
Manuel Adame Jimenez replied to Kyryl_Ning_Support's discussion Chat Feature Update on Ning 3.0 is ready!
"Kyryl can opcion change color chat ... that black color not pretty in my network ... thanks ...
htt…"
3 hours ago
Manuel Adame Jimenez replied to Kyryl_Ning_Support's discussion Chat Feature Update on Ning 3.0 is ready!
"Hi Kyryl ... chatting working thanks ... now for the sound ... greetings Kyryl family ning thanks
♧…"
3 hours ago
Ning via Facebook

#Ning #shop #pricing Choose your ideal price for your unique online community!

M.Tariq Malik replied to Marcelo Rodrigues's discussion Chat problem
"same issue on http://vustudents.ning.com"
9 hours ago
Manuel Adame Jimenez replied to Kyryl_Ning_Support's discussion Network not launched yet issue
"Kyryl came out red shield again ... which means
♤♡♧"
12 hours ago
Paul Corona replied to Marcelo Rodrigues's discussion Chat problem
"Also down:"
13 hours ago
R. Holley replied to Kyryl_Ning_Support's discussion Our Efforts - Your Feedback
"We have 2. That link didn't work even after taking everything out and saving it. I finally got it w…"
15 hours ago
More…