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

Kevin Acosta replied to Kevin Acosta's discussion Photo uploads being auto resized
"Yeah, well please pass along to the programmers in charge of such decisions that this new "feature"…"
7 minutes ago
Ning via Facebook

#createwithNING Each online community is unique and special. What`s YOUR secret of network…

Kyryl_Ning_Support replied to Anastasiia_NING support's discussion Ning 2Q 2017 plan!
"Hi Stanislav,
I do apologise for the misunderstanding. It seems that my colleague has decided that…"
14 hours ago
Kyryl_Ning_Support replied to Kevin Acosta's discussion Photo uploads being auto resized
"Hi there!
The same question has been mentioned in this discussion http://creators.ning.com/forum/to&hellip;"
14 hours ago
Sherry Ritchie and James joined Ning Creators Social Network
15 hours ago
Stanislav replied to Anastasiia_NING support's discussion Ning 2Q 2017 plan!
"Kyryl, here is my ticket log with Anastasia, from which I understood I need to create new page and…"
16 hours ago
Aubrey Williams replied to Aubrey Williams's discussion Paid Access 2017
"Thanks for the response Kyryl, but based on Ning's history of not launching things on time, I can't…"
16 hours ago
Aubrey Williams replied to Aubrey Williams's discussion Paid Access 2017
"Naveen, please tell me more. Were you able to integrate Stripe with your Ning site in a way that re…"
17 hours ago
Kevin Acosta replied to Kevin Acosta's discussion Photo uploads being auto resized
"Well, even the FULL SIZE 38.5" x 36" poster that I attache was scaled down, so now that doesn't eve…"
yesterday
Kyryl_Ning_Support replied to Aubrey Williams's discussion Paid Access 2017
"Hi there,
We plan to initially release the PaidAccess for Ning 3.0 with PayPal and credit card supp…"
yesterday
Kyryl_Ning_Support replied to Naveen Jain's discussion Wiki like functionality in Ning
"Hi there!
Unfortunately, we don't have the module on our platform that would be working in the way…"
yesterday
Kyryl_Ning_Support replied to Anastasiia_NING support's discussion Ning 2Q 2017 plan!
"Hi there!
Thanks for the question.
No, you don't have to create the new network each time the new f…"
yesterday
Matt replied to Aubrey Williams's discussion Paid Access 2017
"Good point, Stripe is awesome. "
yesterday
ASDKFljflkj is now a member of Ning Creators Social Network
yesterday
Alliance replied to Alliance's discussion Profile members on MY Page
"Thanks so much for this help things look sooooo much better now."
yesterday
Bizz ( John ) replied to Alliance's discussion Profile members on MY Page
"You could also try this which I have on my site just now for testing. This will adjust the avatar s…"
Sunday
Bizz ( John ) replied to Alliance's discussion Profile members on MY Page
"As matrix items are shared with other parts of the network if you add that then this would affect t…"
Sunday
Stanislav replied to Anastasiia_NING support's discussion Ning 2Q 2017 plan!
"Hi, I'm waiting you to implement all new features to the Network in Q2 and want to start my network…"
Sunday
Alliance replied to Alliance's discussion Profile members on MY Page
"Thank you 
Right now I have a big space between each item. Following that same logic, the container…"
Sunday
Bizz ( John ) replied to Alliance's discussion Profile members on MY Page
"You can adjust the avatar sizes with this, just change the width to the size required.
.section-mem…"
Saturday
More…