Keyword

Displaying CSV data

  • Oceanwatcher
  • Oceanwatcher's Avatar Topic Author
  • Offline
  • Elite Member
More
14 years 6 months ago #79707 by Oceanwatcher
Displaying CSV data was created by Oceanwatcher
Please take a look at this page:http://www.customgolfsenter.no/index.php?option=com_k2&view=item&layout=item&id=37&Itemid=186There is a table there that is generated from adding a CSV field to an article. But where do I find the styling for this? So far, I have found this section of the K2.css file:87 - /* --- Extra fields: CSV data styling --- */88 - table.csvData {}89 - table.csvData tr th {}90 - table.csvData tr td {}I found another section that might apply:39 - /* --- Zebra rows --- */40 - .even {background:#fffff0;padding:2px;border-bottom:1px dotted #ccc;}41 - .odd {background:#fff;padding:2px;border-bottom:1px dotted #ccc;}I found a section in item.php that relates to the extra fields. The problem is that I kinda get the idea that the display is meant to be different than it looks on my site... Do anyone have any idea how to:1. get more space between each column in the table?2. I think I will make a sub-template to get rid of the name of the table and the h3 heading. I'll fix that on my own.3. And last, it would be nice to get the laternating background going so it is easier to read the results. That would be the zebra rows. But how do I get them to display?

Please Log in or Create an account to join the conversation.

More
14 years 1 month ago #79708 by John Charles Smith
Replied by John Charles Smith on topic Displaying CSV data
I am having the same problem. I have successfully imported the data I need, but the display leaves much to be desired. I have tried manipulating every style associated with the csv I could find:

87 - /* --- Extra fields: CSV data styling --- */
88 - table.csvData {}
89 - table.csvData tr th {}
90 - table.csvData tr td {}

I even added some:

div.catItemExtraFields table {
width: 100%;
border: 2px solid black;
margin: 0;
padding: 0;
}
div.catItemExtraFields th {
font-weight:bold;
font-size: 10px;
text-align:center;
background-color:#ccc;
}
div.catItemExtraFields td {
text-align:left;
font-size:9px;
}

And still no joy. Frankly, changing any of the styles doesn't seem to affect the table at all. Commenting out the styles doesn't affect the appearance either. Has anyone been able to successfully style the imported data table? I would love to know how.

Please Log in or Create an account to join the conversation.

More
14 years 1 month ago #79709 by John Charles Smith
Replied by John Charles Smith on topic Displaying CSV data
I found out how to style the tables.

Starting at line 197 of the k2.css stylesheet is the "div.itemExtraFields" div.

If you add table styles to this class you can style your content. For example:
div.itemExtraFields tr {put styles here for your table rows}
div.itemExtraFields th {put styles here for table headers}
div.itemExtraFields table {put styles here for the table itself}

Please Log in or Create an account to join the conversation.

  • Oceanwatcher
  • Oceanwatcher's Avatar Topic Author
  • Offline
  • Elite Member
More
14 years 1 month ago #79710 by Oceanwatcher
Replied by Oceanwatcher on topic Displaying CSV data
Please note that this post is a very old post. I found some settings that controls the .csv table buried deep inside one of the php files. Will try to find back to that data. Also, this was on 2.2, so I will check if this is still an issue on 2.3.

Please Log in or Create an account to join the conversation.

  • Oceanwatcher
  • Oceanwatcher's Avatar Topic Author
  • Offline
  • Elite Member
More
14 years 1 month ago #79711 by Oceanwatcher
Replied by Oceanwatcher on topic Displaying CSV data
Cellspacing and cellpadding is hardcoded in the php file and both are set to 0. Don't know if a CSS value will override it. Maybe necessary to remove it from php first.

John Charles Smith said:I found out how to style the tables.
Starting at line 197 of the k2.css stylesheet is the "div.itemExtraFields" div.

If you add table styles to this class you can style your content. For example:
div.itemExtraFields tr {put styles here for your table rows}
div.itemExtraFields th {put styles here for table headers}
div.itemExtraFields table {put styles here for the table itself}

Please Log in or Create an account to join the conversation.

  • Oceanwatcher
  • Oceanwatcher's Avatar Topic Author
  • Offline
  • Elite Member
More
14 years 1 month ago #79712 by Oceanwatcher
Replied by Oceanwatcher on topic Displaying CSV data
Searched through the code and found this:

the file item.php in

/components/com_k2/models

has the code for the .csv table around line 775

There you find

table cellspacing="0" cellpadding="0" class="csvTable"

This should be a good starting point for fixing the tables :-)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum